CVE-2024-8698 — keycloak-saml-core
HIGHCVE-2024-8698 is a high-severity (CVSS 7.7) CWE-347 vulnerability in org.keycloak:keycloak-saml-core. 2 public exploit or proof-of-concept references are indexed, so weaponization risk is real. A fix is available for org.keycloak:keycloak-saml-core — see the affected versions and patch details below.
Keycloak-saml-core: improper verification of saml responses leading to privilege escalation in keycloak
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2024-8698.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
org.keycloak:keycloak-saml-core☕org.keycloak:keycloak-saml-core☕org.keycloak:keycloak-saml-coreReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Maven packages — download data is not available via public APIs for these ecosystems.
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| ☕Maven | org.keycloak:keycloak-saml-core | all versions | 22.0.13org.keycloak:keycloak-saml-core:22.0.13 |
| ☕Maven | org.keycloak:keycloak-saml-core | ≥ 23.0.0&&< 24.0.8 | 24.0.8org.keycloak:keycloak-saml-core:24.0.8 |
| ☕Maven | org.keycloak:keycloak-saml-core | ≥ 25.0.0&&< 25.0.6 | 25.0.6org.keycloak:keycloak-saml-core:25.0.6 |
Research use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for org.keycloak:keycloak-saml-core, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update org.keycloak:keycloak-saml-core to 22.0.13 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2024-8698 is resolved across your whole dependency graph.
Workarounds
Close the privilege gap rather than the entry point: audit which accounts, roles and service identities can reach the affected operation, drop the component to the least privilege it actually needs, and review file and directory permissions created by earlier installs — a default left in place is what makes this reachable.
How to detect CVE-2024-8698
A community-maintained Nuclei template exists for this CVE. You can scan for it directly:
nuclei -id cve-2024-8698 -u https://target- Template
- Keycloak - SAML Core Package Signature Validation Flaw
- Severity
- high
- Impact
- Attackers can create crafted SAML responses that bypass signature validation, potentially leading to privilege escalation, impersonation attacks, and unauthorized access to protected resources in Keycloak.
- Remediation
- Apply Red Hat security updates (RHSA-2024:6878, RHSA-2024:6879, RHSA-2024:6880, RHSA-2024:6882) to address the SAML signature validation flaw in Keycloak XMLSignatureUtil class.
Template by ProjectDiscovery nuclei-templates (iamnoooob, rootxharsh, pdresearch), MIT licensed. View the full template. Scan only systems you are authorised to test.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
This vulnerability is of high severity due to its potential to facilitate privilege escalation and user impersonation in systems using SAML for authentication. The core issue stems from improper validation logic in Keycloak's signature validation method, which relies on the position of signatures rather than…
Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.Source: Red Hat security advisory for CVE-2024-8698 (CC BY 4.0)
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat Build of Keycloak | see advisory | RHSA-2024:6888 |
| Red Hat Build of Keycloak | keycloak-saml-core | RHSA-2024:6890 |
| Red Hat build of Keycloak 22 | rhbk/keycloak-operator-bundle:22.0.13-1 | RHSA-2024:6887 |
| Red Hat build of Keycloak 24 | rhbk/keycloak-operator-bundle:24.0.8-1 | RHSA-2024:6889 |
| Red Hat JBoss Enterprise Application Platform 8 | keycloak-saml-core-public | RHSA-2024:8826 |
| Red Hat JBoss Enterprise Application Platform 8.0 for RHEL 8 | eap8-activemq-artemis-0:2.33.0-1.redhat_00015.1.el8eap | RHSA-2024:8823 |
| Red Hat JBoss Enterprise Application Platform 8.0 for RHEL 9 | eap8-activemq-artemis-0:2.33.0-1.redhat_00015.1.el9eap | RHSA-2024:8824 |
| Red Hat Single Sign-On 7 | keycloak-saml-core | RHSA-2024:6886 |
Frequently Asked Questions
Is CVE-2024-8698 in your dependencies?
Find it across Maven, including transitive dependencies.