Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconAuthenticate as low-privileged realm user
-
DeliveryIdentify client with token-exchange enabled and privileged service account
-
ExploitCraft token-exchange request with oversized subject_token JWT (>4000 chars)
-
InstallSubmit to TokenEndpoint, oversized token silently dropped
-
C2Server falls back to client-credentials grant
-
ExecuteReceive access token bound to client service account
-
ImpactInvoke privileged APIs with escalated scope
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V2 - Validation and Business Logic Input size validation
|
| Exploitation Conditions | The attacker needs valid authentication to the Keycloak realm at low privilege (PR:L) and must be able to authenticate as, or on behalf of, a confidential or public OAuth client that has the token-exchange grant enabled - token exchange is not enabled by default on every client, so realms that have never configured token exchange are not exposed via this code path. Exploitation also requires that the targeted client has a service account whose roles are more privileged than the attacker's own user, otherwise the 'escalation' yields no net gain. No user interaction is required (UI:N), the attack is fully remote over the network to the Keycloak token endpoint (AV:N), and complexity is low (AC:L) - the attacker just inflates the subject_token JWT past 4000 characters. Limiting factors: requires an existing account, requires token-exchange to be enabled on a reachable client, and the practical impact is bounded by the service account's role assignments. |
| Impact | Signals are mixed and lean toward a credible but not urgent priority. CVSS 8.8 (AV:N/AC:L/PR:L/UI:N) reflects network-reachable exploitation with low complexity, only low privileges required, and full confidentiality/integrity/availability impact on the realm - meaningful because the attacker pivots to a service-account identity with potentially broad scopes. However, EPSS is only 0.04% (11th percentile) and CISA SSVC scores Exploitation: none and Automatable: no, indicating no observed in-the-wild activity and no straightforward mass-exploitation pathway; Technical Impact is rated total, consistent with the privilege-escalation outcome. Real-world risk depends heavily on how privileged the target client's service account is - a client whose service account holds realm-admin or sensitive resource-server roles makes this a critical issue, whereas a client with minimal service-account scopes makes it a low-impact bug. No public exploit identified at time of analysis, and no KEV listing. |
| Exploit ScenarioDerived | An attacker who has obtained any low-privileged Keycloak user account (for example via self-registration in a realm that allows it, or through compromise of a non-privileged employee account) sends a crafted POST to the OAuth2 TokenEndpoint requesting a token-exchange grant, attaching client credentials for any client they can authenticate as and a subject_token JWT padded beyond 4000 characters. The server silently drops the oversized subject_token and falls back to client credentials, returning an access token bound to that client's service account; the attacker then uses that token to call APIs or Keycloak admin endpoints with the service account's roles. No public exploit identified at time of analysis, but the technique is straightforward to script once the behavior is understood. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv3 – Jun 10, 2026
Privilege escalation in Red Hat Build of Keycloak allows low-privileged authenticated users to assume the permissions of a client's service account by submitting an oversized subject_token JWT to the TokenEndpoint. When the token exceeds the 4000-character limit it is silently discarded rather than rejected, causing the server to fall back to client-credentials authentication and grant the attacker the client's service-account scope. No public exploit identified at time of analysis and EPSS is very low (0.04%), but CVSS rates the issue 8.8 due to full CIA impact post-exploitation.
Earlier versions of this analysis (2)
Privilege escalation in Red Hat Build of Keycloak allows an authenticated low-privileged user to assume the permissions of a client's service account by submitting an oversized subject_token JWT (greater than 4000 characters) to the TokenEndpoint, which is silently discarded and causes the server to fall back to client credentials. The flaw carries a CVSS 8.8 (High) score but no public exploit identified at time of analysis, an EPSS of 0.04%, and CISA SSVC reports no observed exploitation despite a 'total' technical impact rating.
Privilege escalation in Keycloak exposes service account permissions to authenticated low-privilege users through a silent JWT size-check failure at the TokenEndpoint. When a subject_token JWT exceeding 4000 characters is submitted, Keycloak silently discards it and falls back to client credentials - granting the attacker the permissions of the client's service account without any explicit authorization decision. SSVC rates technical impact as total (full confidentiality and integrity compromise), though CVSS AC:H and no public exploit identified at time of analysis temper the immediacy of widespread exploitation. This is a Red Hat-reported issue tracked in their Bugzilla at #2481877.
RemediationAI
Patch available per vendor advisory: apply the updates shipped in RHSA-2026:25097 (https://access.redhat.com/errata/RHSA-2026:25097) and RHSA-2026:25098 (https://access.redhat.com/errata/RHSA-2026:25098), which correspond to the patched Red Hat Build of Keycloak releases; exact fix version numbers should be confirmed against the linked errata for your specific Keycloak stream. Until patching is complete, compensating controls include disabling the token-exchange feature on clients that do not require it (this breaks any delegation flows that rely on subject_token swap), restricting which clients are permitted to perform token exchange via the fine-grained admin permission model, tightly scoping each client's service-account roles to the minimum necessary so a fallback to client credentials does not yield administrative permissions, and adding a reverse-proxy or WAF rule that rejects token-endpoint requests whose subject_token parameter exceeds ~4000 characters (trade-off: legitimate large JWTs with many claims may be blocked). Monitor Keycloak audit logs for token-exchange requests that result in client-credentials grants from accounts that previously used a subject_token.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in maven
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Keycloak is Red Hat's open-source identity and access management server implementing OAuth 2.0, OIDC, and SAML, with the affected component being the OAuth2 TokenEndpoint that handles token exchange and grant processing. The root cause maps to CWE-1284 (Improper Validation of Specified Quantity in Input): the endpoint enforces a 4000-character ceiling on the subject_token parameter but, instead of returning an error when the limit is exceeded, silently drops the token and continues processing the request. Because token exchange requests typically also carry client credentials, the server then authenticates the request as the client itself and issues a token bound to the client's service account rather than the original subject - effectively converting a malformed delegation request into a successful client-credentials grant. The CPE confirms the impact applies to cpe:2.3:a:redhat:build_of_keycloak (Red Hat's hardened distribution of upstream Keycloak).
Know when Build Of 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:H/I:H/A:H
Remote token endpoint (AV:N), trivial oversized-JWT trick (AC:L), requires a low-privileged account (PR:L), no user interaction; escalation to service account yields full CIA within the realm.
Primary rating from NVD.
CVSS VectorNVD
Lifecycle Timeline
4DescriptionNVD
A flaw was found in Keycloak. An authenticated user with low privileges can exploit this vulnerability by sending an oversized subject_token JSON Web Token (JWT) to the TokenEndpoint. When the token exceeds a 4000-character limit, it is silently dropped, causing the system to fall back to client credentials. This allows the user to gain the permissions of the client's service account, leading to privilege escalation.
Blast Radius
ecosystem impact- 81 maven packages depend on org.keycloak:keycloak-server-spi-private (45 direct, 36 indirect)
- 70 maven packages depend on org.keycloak:keycloak-services (36 direct, 34 indirect)
Ecosystem-wide dependent count for version 26.6.3 and other introduced versions.
Executive ViewAI
Red Hat Build of Keycloak contains a privilege escalation vulnerability (CVE-2026-9704) allowing authenticated users to assume the permissions of critical service accounts, creating a direct pathway to unauthorized access of downstream systems and sensitive data. Organizations using Keycloak for identity management face elevated risk where service accounts hold elevated privileges to critical infrastructure or data systems. With no vendor patch currently available and high CVSS severity (8.8), immediate compensating controls are essential to prevent unauthorized service account activity and potential data exposure.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) Implement WAF or firewall rules to block JWT tokens exceeding 4000 characters at TokenEndpoint; (2) Restrict TokenEndpoint network access to only pre-approved applications and internal systems; (3) Enable comprehensive audit logging for all service account authentication attempts and permission assertions; (4) Conduct immediate audit of service account permissions and remove any exceeding least-privilege requirements; (5) Deploy real-time monitoring and alerting for suspicious TokenEndpoint access patterns, repeated authentication failures, or unusual service account activity; (6) If operationally feasible, temporarily disable subject_token-based authentication methods pending patch release.
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
Privilege escalation occurs when an attacker leverages flaws in access control mechanisms to gain permissions beyond what they were originally granted.
Affected Products (CPE)NVD
More in Build Of Keycloak
View allA misconfiguration flaw was found in Keycloak. Rated medium severity (CVSS 6.1), this vulnerability is remotely exploita
Keycloak's SAML identity provider broker fails to enforce client disabled status during IdP-initiated SSO flows, allowin
A flaw was found in Keycloak, where it does not properly validate URLs included in a redirect. Rated high severity (CVSS
HTTP parameter pollution in Keycloak enables authentication bypass against deployments where OAuth/OIDC client applicati
Keycloak's IdentityBrokerService.performLogin endpoint fails to enforce disabled Identity Provider restrictions, allowin
A vulnerability was found in Undertow where the ProxyProtocolReadListener reuses the same StringBuilder instance across
A session fixation issue was discovered in the SAML adapters provided by Keycloak. Rated high severity (CVSS 7.1), this
A vulnerability was found in Wildfly, where a user may perform Cross-site scripting in the Wildfly deployment system. Ra
Refresh token replay in Keycloak allows a remote attacker who has previously captured a user's refresh token to reuse th
Privilege escalation in Keycloak's Fine-Grained Admin Permissions v2 (FGAPv2) allows administrative users with the manag
A vulnerability was found in Keycloak. Rated medium severity (CVSS 6.5), this vulnerability is remotely exploitable, no
An open redirect vulnerability was found in Keycloak. Rated medium severity (CVSS 6.1), this vulnerability is remotely e
EUVD-2026-32300
GHSA-rr5q-3xwr-f323
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB