Keycloak Vulnerable to Improper Validation of Specified Quantity in Input
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 software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Java / Kotlin (Maven) | org.keycloak:keycloak-server-spi-private | < 26.6.3 | 26.6.3 |
| Java / Kotlin (Maven) | org.keycloak:keycloak-services | < 26.6.3 | 26.6.3 |
References
- https://nvd.nist.gov/vuln/detail/CVE-2026-9704
- https://github.com/keycloak/keycloak/issues/49435
- https://github.com/keycloak/keycloak/pull/49472
- https://github.com/keycloak/keycloak/commit/f1e5b7776c42938d0782fd5846346b8f75c815e6
- https://access.redhat.com/errata/RHSA-2026:25097
- https://access.redhat.com/errata/RHSA-2026:25098
- https://access.redhat.com/errata/RHSA-2026:30049
- https://access.redhat.com/errata/RHSA-2026:30050
- https://access.redhat.com/security/cve/CVE-2026-9704
- https://bugzilla.redhat.com/show_bug.cgi?id=2481877
- https://github.com/keycloak/keycloak
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N- Weakness (CWE)
CWE-1284- Platform
- Java / Kotlin (Maven)
- Package
org.keycloak:keycloak-server-spi-private, org.keycloak:keycloak-services- Disclosed
- 27.05.2026
- Updated
- 11.10.2026 12:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-rr5q-3xwr-f323 - CC BY 4.0
Vulnerability history: org.keycloak:keycloak-server-spi-private
All published vulnerabilities of this package (Java / Kotlin (Maven)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 7
- First → latest
- 02.2022 05.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- High 1
- Medium 5
- Low 1
Disclosures per year
- 2022: 1
- 2023: 1
- 2024: 0
- 2025: 0
- 2026: 5
-
Keycloak Vulnerable to Improper Validation of Specified Quantity in Input this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.