CVE-2026-9704: Keycloak: keycloak: privilege escalation due to oversized subject_token jwt
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.
This Keycloak flaw lets a logged-in low-privilege user trigger an authentication fallback that can grant the client service account's permissions. Business risk depends on how powerful those service accounts are. The source bundle does not name a fixed version or active exploitation.
Executive priority
Prioritize review this week for environments where Keycloak service accounts can access sensitive data or administrative functions. The CVSS is medium, but privilege escalation to over-permissioned service accounts can create high business impact.
Technical view
The TokenEndpoint mishandles an oversized subject_token JWT. When the token exceeds a 4000-character limit, it is silently dropped and processing falls back to client credentials, allowing privilege escalation to the client's service account. Red Hat maps this to CWE-1284 and CVSS 6.8.
Likely exposure
Exposure is limited to Red Hat Build of Keycloak deployments, specifically the rhbk/keycloak-rhel9 package listed as affected. The bundle provides no affected version range, so teams should treat installed Red Hat Build of Keycloak instances as requiring vendor verification.
Exploitation context
The attack requires an authenticated low-privilege user and high attack complexity. No KEV listing or cited source in the bundle supports active exploitation. Impact can be serious where client service accounts hold broad permissions.
Researcher notes
Evidence supports a logic/validation failure around subject_token size handling and fallback behavior. The source bundle does not provide fixed versions, affected version ranges, public exploit status, or vendor workaround details beyond the Red Hat references.
Mitigation direction
Check Red Hat guidance for fixed builds or official workarounds.
Inventory Red Hat Build of Keycloak rhbk/keycloak-rhel9 deployments.
Reduce service-account permissions for affected clients where business-safe.
Limit TokenEndpoint access to trusted authenticated clients where feasible.
Monitor vendor advisories for version-specific remediation details.
Validation and detection
Confirm whether deployed Keycloak builds match Red Hat Build of Keycloak.
Review clients with enabled service accounts and elevated permissions.
Check authentication logs for abnormal TokenEndpoint requests with oversized subject_token values.
Track Red Hat CVE and Bugzilla updates for affected version details.
Verify compensating controls do not break required authentication flows.
Based on public source material and reviewed before publication.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-1284: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
The CVE wording references authentication or credential exposure, so valid-account and credential-access review may help. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
The CVE wording references privilege impact, so privilege escalation and authorization behavior review may help. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve
time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
5Timeline events
1ADP providers
3Source links
SSVC decision data
CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: noTechnical Impact: total
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present,
the table keeps the source vectors side by side instead of collapsing them into the highest score.