Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAuthenticate as low-privileged Keycloak user
-
DeliveryTarget realm using JSON-type protocol mapper
-
ExploitInject forged client roles into JSON claim
-
ExecutionBypass Java-map-only role sanitization
-
PersistReceive token with escalated roles
-
ImpactAccess protected resources
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Input validation, allowlisting
|
| Exploitation Conditions | Exploitation requires a Keycloak realm in which a protocol mapper is configured to emit structured claims using the JSON type - this is a specific non-default configuration, not stock behavior. The attacker must hold an authenticated low-privileged account (CVSS PR:L), after which the sanitization routine's failure to recognize Jackson-based JSON objects (it inspects only standard Java maps) lets forged client roles pass into the issued token. Limiting factors: realms not using a JSON-type structured-claim mapper are not affected, and valid credentials are required, so unauthenticated exploitation is not possible; impact is limited to integrity/authorization (C:N, A:N). |
| Impact | This is a moderate-severity authorization flaw (CVSS 6.5) in Keycloak's token sanitization logic. The CVSS vector CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N indicates a network-reachable, low-complexity attack that requires low-level authentication (PR:L) and no user interaction, with impact confined to integrity (I:H) - no confidentiality or availability loss. The vuln.today decision label is 'this_month', not 'act_now' or 'emergency', consistent with a real but non-critical priority. No EPSS score, CISA KEV listing, or POC/exploit reference is present in the supplied data, so there is no public exploit identified at time of analysis and no evidence of active exploitation. Two signals temper the raw score: exploitation depends on a specific non-default configuration (a protocol mapper emitting JSON-type structured claims), and the attacker must already hold an authenticated account. Taken together these point to a legitimate but conditional authorization-integrity risk rather than a widespread, trivially exploitable issue - schedule patching this cycle rather than treating it as an emergency. |
| Exploit ScenarioDerived | In a Keycloak realm where a protocol mapper is configured to emit structured claims using the JSON type, an authenticated low-privileged user requests a security token. Because the role-sanitization check only recognizes standard Java maps and ignores Jackson-based JSON objects, forged client roles embedded in the JSON claim survive sanitization and are issued in the token, which the attacker then presents to reach protected resources beyond their granted authorization. No public exploit is identified at time of analysis. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 06, 2026
Keycloak's token sanitization logic can be bypassed so that forged client roles are written into issued security tokens, giving an authenticated low-privileged user access to resources protected by those roles (CVSS 6.5, integrity-only impact). The flaw only manifests in realms where a protocol mapper is configured to emit structured claims using the JSON type, because the sanitizer inspects only standard Java maps and does not recognize Jackson-based JSON objects; realms without such a mapper are unaffected. The CVSS vector (AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N) confirms valid credentials are required, so unauthenticated exploitation is not possible, and no public exploit code or CISA KEV entry is associated with this CVE at time of analysis.
RemediationAI
No fixed Keycloak version is stated in the supplied data, so confirm the patched build from the Red Hat advisory (https://access.redhat.com/security/cve/CVE-2026-97848) and the Bugzilla entry (https://bugzilla.redhat.com/show_bug.cgi?id=2540960) and upgrade to that release when it is identified. Until then, the most direct compensating control is configuration-level: inventory every realm's protocol mappers and remove or replace any mapper configured to emit structured claims with the JSON type - mapping the same claim as a String type or via a mapper that produces a standard Java map keeps the sanitizer effective, at the cost of changing the token claim format for downstream resource servers that may parse it as JSON. Where such mappers cannot be removed, restrict the roles assigned to low-privileged accounts and audit token issuance for unexpected client role claims, though this reduces rather than eliminates exposure because the sanitization bypass itself remains. Additional vendor guidance and any configuration flags should be taken from the advisory rather than assumed, and resource servers that perform authorization purely on token role claims should be reviewed for additional server-side role checks as a defense in depth.
Affected VersionsENISA
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Keycloak protocol mappers shape the claims placed into access, ID and refresh tokens; some mappers emit structured claims, and when the JSON claim type is selected the resulting value is a Jackson-serialized JSON object rather than a java.util.Map. The pre-issuance sanitization routine that strips unauthorized role mappings performs its type check against standard Java map implementations, so a Jackson JSON object passes through uninspected and attacker-supplied client role entries survive into the token. The root cause class is CWE-20 (improper input validation) - a type-confusion-style validation gap in which the security control's assumption about the concrete object type does not hold for all supported mapper configurations. Because the flaw lives in claim sanitization rather than in authentication, the resulting failure mode is an authorization/integrity problem: downstream resource servers that trust the role claims in the token grant access the user should not have. Exploitability is gated by two concrete preconditions stated in the assessment: the realm must use a JSON-typed structured-claim protocol mapper, and the attacker must hold a valid low-privileged account. The exact mechanics of how the forged role entries are injected into the mapper output are not described in the available sources.
Know when Keycloak gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N
Network-facing token endpoint with low complexity; an authenticated low-privileged account is required so PR:L; impact is forged-role integrity only, so C:N/I:H/A:N.
Primary rating from Vendor (redhat).
CVSS VectorVendor: redhat
DescriptionCVE.org
A flaw was found in the token sanitization logic of Keycloak, an open source identity and access management solution. The issue occurs when a protocol mapper is configured to emit structured claims using the JSON type. The security check designed to remove unauthorized role mappings only looks for standard Java maps and fails to recognize Jackson based JSON objects. This allows an attacker to inject forged client roles into security tokens, which could lead to unauthorized access to protected resources.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.
The SSH transport protocol with certain OpenSSH extensions, found in OpenSSH before 9.6 and other products, allows remot
The org.keycloak.services.resources.SocialResource.callback method in JBoss KeyCloak before 1.0.3.Final allows remote at
A flaw was found in Keycloak, where it does not properly validate URLs included in a redirect. Rated high severity (CVSS
An unconstrained memory consumption vulnerability was discovered in Keycloak. Rated high severity (CVSS 7.7), this vulne
Due to improper authorization, Red Hat Single Sign-On is vulnerable to users performing actions that they should not be
It was found that the Keycloak Node.js adapter 2.5 - 3.0 did not handle invalid tokens correctly. Rated critical severit
Authentication bypass in the Apache Airflow Keycloak auth manager provider (apache-airflow-providers-keycloak below 0.10
A privilege escalation flaw was found in the token exchange feature of keycloak. Rated critical severity (CVSS 9.8), thi
A vulnerability was found in keycloak 7.x, when keycloak is configured with LDAP user federation and StartTLS is used in
A flaw was found in keycloak in versions before 13.0.0. Rated critical severity (CVSS 9.6), this vulnerability is remote
A flaw was found in Keycloak that prevents certain schemes in redirects, but permits them if a wildcard is appended to t
A flaw was found in Keycloak. Rated medium severity (CVSS 5.4), this vulnerability is remotely exploitable, low attack c
EUVD-2026-117923
GHSA-43w4-wpq4-5p8q
NVD
CVE.org
EPSS
VulDB
Exploit-DB