REDHAT-BUG-2584740: Medium severity Red Hat Keycloak vulnerability
A vulnerability was found in Keycloak where the SAML identity provider brokering mechanism fails to perform a case-sensitive validation of the asserted subject. When a realm brokers logins from a SAML identity provider, Keycloak looks up the federated identity link using a plain database equality query against the FEDERATEDUSERID column. If the underlying database uses a case-insensitive collation, a signed SAML assertion containing a subject that differs only in case (e.g., Alice vs alice) will resolve to the same federated identity link. Keycloak does not perform a secondary case-sensitive check on the returned value. An attacker can exploit this to obtain a valid access token for a victim's account, effectively bypassing authentication for the intended user.
Affected Software
Event History
Frequently Asked Questions
Which deployments are exposed to this issue?
The issue affects realms that broker logins from a SAML identity provider and use an underlying database with a case-insensitive collation for the federated identity lookup.
What does an attacker need to exploit it?
The attacker needs a signed SAML assertion whose asserted subject differs from a victim's federated identity subject only by letter case. The database lookup can then resolve that assertion to the victim's federated identity link.
What is the practical impact of a successful exploit?
A successful attacker can obtain a valid access token for the victim's account, bypassing authentication for the intended user.