REDHAT-BUG-2501720: Medium severity Keycloak Keycloak vulnerability
A vulnerability was found in Keycloak where the LDAP storage provider fails to validate the search base during specific entry-DN queries. A delegated administrator with user-query permissions can invoke the admin users endpoint with a crafted query parameter (q=LDAPENTRYDN:target-dn). The LDAP provider replaces the configured users DN with the caller-supplied DN and performs an object-scope lookup. If the target object matches the user schema, Keycloak returns the UserRepresentation and may import the user into local storage. This allows an attacker to bypass organizational unit boundaries within the same LDAP directory to disclose user attributes and metadata for accounts they should not be able to access.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Restrict access to Keycloak's admin users endpoint so that only trusted administrators (no delegated admins with user-query permissions) can invoke it, to prevent crafted query parameters (e.g., q=LDAP_ENTRY_DN:target-dn) from triggering LDAP search base validation bypass.