CVE-2024-8698 Keycloak-saml-core: improper verification of saml responses leading to privilege escalation in keycloak
Attackers can bypass SAML signature validation to escalate privileges or impersonate users in Keycloak deployments.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-8698?
CVE-2024-8698 is a high-severity authentication bypass vulnerability in Red Hat RHEL-8 based Middleware Containers, published on 19 Sep 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Official description
A flaw exists in the SAML signature validation method within the Keycloak XMLSignatureUtil class. The method incorrectly determines whether a SAML signature is for the full document or only for specific assertions based on the position of the signature in the XML document, rather than the Reference element used to specify the signed element. This flaw allows attackers to create crafted responses that can bypass the validation, potentially leading to privilege escalation or impersonation attacks.
Weakness: CWE-347
Which versions are affected by CVE-2024-8698?
6 open source packages ship an affected version, including org.keycloak:keycloak-saml-core.
| Package | Affected | Fixed in |
|---|---|---|
org.keycloak:keycloak-saml-core Maven | All versions | 22.0.13 |
org.keycloak:keycloak-saml-core Maven | All versions | 22.0.13 |
org.keycloak:keycloak-saml-core Maven | From 23.0.0 | 24.0.8 |
org.keycloak:keycloak-saml-core Maven | From 23.0.0 | 24.0.8 |
org.keycloak:keycloak-saml-core Maven | From 25.0.0 | 25.0.6 |
org.keycloak:keycloak-saml-core Maven | From 25.0.0 | 25.0.6 |
How do I fix CVE-2024-8698?
Upgrade org.keycloak:keycloak-saml-core to a fixed version for your release line: 22.0.13, 24.0.8 or 25.0.6.
Upgrade, and rotate credentials and sessions that may have been exposed. More about Authentication bypass.
Is CVE-2024-8698 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-8698 exists.
Public exploit code: 1 Nuclei template and 1 proofs of concept on GitHub.
Sources
Also known as GHSA-xgfv-xpx8-qhcr.