Keycloak: keycloak: privilege escalation due to oversized subject_token jwt
Published May 27, 2026
8.8
HIGHCVSS 3.1
EPSS 0.59%
Description
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.
Affected products
No data.
- n/a
No data.
Red Hat build of Keycloak 26.4
rhbk/keycloak-operator-bundle:26.4.13-1
Fixed · RHSA-2026:30050
Red Hat build of Keycloak 26.4
rhbk/keycloak-rhel9-operator:26.4-19
Fixed · RHSA-2026:30050
Red Hat build of Keycloak 26.4
rhbk/keycloak-rhel9:26.4-19
Fixed · RHSA-2026:30050
Red Hat build of Keycloak 26.4.13
rhbk/keycloak-rhel9
Fixed · RHSA-2026:30049
Red Hat build of Keycloak 26.6
rhbk/keycloak-operator-bundle:26.6.3-3
Fixed · RHSA-2026:25097
Red Hat build of Keycloak 26.6
rhbk/keycloak-rhel9-operator:26.6-6
Fixed · RHSA-2026:25097
Red Hat build of Keycloak 26.6
rhbk/keycloak-rhel9:26.6-6
Fixed · RHSA-2026:25097
Red Hat build of Keycloak 26.6.3
rhbk/keycloak-rhel9
Fixed · RHSA-2026:25098
| Product | Package | State | Advisory |
|---|---|---|---|
| Red Hat build of Keycloak 26.4 | rhbk/keycloak-operator-bundle:26.4.13-1 | Fixed | RHSA-2026:30050 |
| Red Hat build of Keycloak 26.4 | rhbk/keycloak-rhel9-operator:26.4-19 | Fixed | RHSA-2026:30050 |
| Red Hat build of Keycloak 26.4 | rhbk/keycloak-rhel9:26.4-19 | Fixed | RHSA-2026:30050 |
| Red Hat build of Keycloak 26.4.13 | rhbk/keycloak-rhel9 | Fixed | RHSA-2026:30049 |
| Red Hat build of Keycloak 26.6 | rhbk/keycloak-operator-bundle:26.6.3-3 | Fixed | RHSA-2026:25097 |
| Red Hat build of Keycloak 26.6 | rhbk/keycloak-rhel9-operator:26.6-6 | Fixed | RHSA-2026:25097 |
| Red Hat build of Keycloak 26.6 | rhbk/keycloak-rhel9:26.6-6 | Fixed | RHSA-2026:25097 |
| Red Hat build of Keycloak 26.6.3 | rhbk/keycloak-rhel9 | Fixed | RHSA-2026:25098 |
No package ranges for this CVE.
Remediation
Vendor solution
To prevent the silent dropping of oversized `subject_token` JWTs, configure Keycloak to enforce strict parameter validation. This involves setting the `fail-fast` parameter to `true` for the `TokenEndpoint` configuration, which will cause requests with oversized parameters to be rejected explicitly rather than silently processed with reduced privileges. Consult Keycloak documentation for the exact method to modify these settings. A restart of the Keycloak service may be necessary for the changes to apply.
Red Hat statement
This Moderate flaw in Keycloak allows an authenticated, low-privileged user to escalate privileges. By submitting an oversized `subject_token` JWT to the TokenEndpoint, the system defaults to client credentials, granting the attacker the client's service account permissions. This bypass occurs when the token exceeds a 4000-character limit, leading to an unintended privilege gain.
Red Hat mitigation
To prevent the silent dropping of oversized `subject_token` JWTs, configure Keycloak to enforce strict parameter validation. This involves setting the `fail-fast` parameter to `true` for the `TokenEndpoint` configuration, which will cause requests with oversized parameters to be rejected explicitly rather than silently processed with reduced privileges. Consult Keycloak documentation for the exact method to modify these settings. A restart of the Keycloak service may be necessary for the changes to apply.
References (13)
- https://access.redhat.com/errata/RHSA-2026:25097 vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:25098 vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:30049 vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:30050 vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/security/cve/CVE-2026-9704 vdb-entryx_refsource_REDHATMitigationVendor Advisory
- https://bugzilla.redhat.com/show_bug.cgi?id=2481877 issue-trackingx_refsource_REDHATIssue TrackingVendor Advisory
- https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-32300 Advisory
- https://github.com/advisories/GHSA-rr5q-3xwr-f323 Advisory
- https://github.com/keycloak/keycloak/commit/f1e5b7776c42938d0782fd5846346b8f75c815e6
- https://github.com/keycloak/keycloak/issues/49435
- https://github.com/keycloak/keycloak/pull/49472
- https://nvd.nist.gov/vuln/detail/CVE-2026-9704
- https://www.cve.org/CVERecord?id=CVE-2026-9704
| Link | Providers | Tags |
|---|---|---|
| https://access.redhat.com/errata/RHSA-2026:25097 | vendor-advisoryx_refsource_REDHAT | |
| https://access.redhat.com/errata/RHSA-2026:25098 | vendor-advisoryx_refsource_REDHAT | |
| https://access.redhat.com/errata/RHSA-2026:30049 | vendor-advisoryx_refsource_REDHAT | |
| https://access.redhat.com/errata/RHSA-2026:30050 | vendor-advisoryx_refsource_REDHAT | |
| https://access.redhat.com/security/cve/CVE-2026-9704 | vdb-entryx_refsource_REDHATMitigationVendor Advisory | |
| https://bugzilla.redhat.com/show_bug.cgi?id=2481877 | issue-trackingx_refsource_REDHATIssue TrackingVendor Advisory | |
| https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-32300 | Advisory | |
| https://github.com/advisories/GHSA-rr5q-3xwr-f323 | Advisory | |
| https://github.com/keycloak/keycloak/commit/f1e5b7776c42938d0782fd5846346b8f75c815e6 | ||
| https://github.com/keycloak/keycloak/issues/49435 | ||
| https://github.com/keycloak/keycloak/pull/49472 | ||
| https://nvd.nist.gov/vuln/detail/CVE-2026-9704 | ||
| https://www.cve.org/CVERecord?id=CVE-2026-9704 |
Change history (0)
No recorded changes yet.
CVE.org / MITRE
CISA Vulnrichment
GitHub