{"id":"CVE-2026-9704","published":"2026-05-27T12:56:00Z","modified":"2026-06-26T06:46:25Z","title":"Keycloak: keycloak: privilege escalation due to oversized subject_token jwt","vendor":"Red Hat","product":"Red Hat build of Keycloak 26.4","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.8,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.0032,"percentile":0.25681,"provenance":"source"},"cwes":[{"id":"CWE-1284","name":"Improper Validation of Specified Quantity in Input"}],"references":[{"url":"https://access.redhat.com/errata/RHSA-2026:25097","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:25098","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:30049","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:30050","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/security/cve/CVE-2026-9704","tags":["vdb-entry","x_refsource_REDHAT"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2481877","tags":["issue-tracking","x_refsource_REDHAT"]}],"priority":{"score":9.9,"factors":[{"name":"EPSS percentile","points":5.14},{"name":"CVSS severity","points":4.76}]},"vendorSlug":"red-hat","affectedVersions":[{"vendor":"Red Hat","product":"Red Hat build of Keycloak 26.4","versions":["all versions"]},{"vendor":"Red Hat","product":"Red Hat build of Keycloak 26.4","versions":["all versions"]},{"vendor":"Red Hat","product":"Red Hat build of Keycloak 26.4","versions":["all versions"]},{"vendor":"Red Hat","product":"Red Hat build of Keycloak 26.6","versions":["all versions"]},{"vendor":"Red Hat","product":"Red Hat build of Keycloak 26.6","versions":["all versions"]},{"vendor":"Red Hat","product":"Red Hat build of Keycloak 26.6","versions":["all versions"]}],"workarounds":{"items":["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."],"from":"CVE.org CNA","provenance":"source"},"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2026-05-27T15:29:17.278859Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Maven","package":"org.keycloak:keycloak-server-spi-private","vulnerableRanges":["<26.6.3"],"patched":["26.6.3"],"from":["GHSA-rr5q-3xwr-f323"],"provenance":"source"},{"ecosystem":"Maven","package":"org.keycloak:keycloak-services","vulnerableRanges":["<26.6.3"],"patched":["26.6.3"],"from":["GHSA-rr5q-3xwr-f323"],"provenance":"source"}],"summary":{"text":"The flaw is in Red Hat build of Keycloak 26.4, where the token exchange handling at the TokenEndpoint silently drops oversized subject_token JWTs, falling back to client credentials. An attacker with low-privilege authenticated access can exploit this by submitting a subject_token that exceeds the 4000-character limit over the network, with no user interaction required, to gain the permissions of the client's service account.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:03:49Z"},"euvd":{"id":"EUVD-2026-32300","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-red-hat-build-of-keycloak-26-4-cve-2023-2585","parents":[{"from":"CVE-2023-2585","to":"CVE-2026-9704","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["services/src/main/java/org/keycloak/protocol/oidc/grants/ciba/CibaGrantType.java","services/src/main/java/org/keycloak/protocol/oidc/grants/device/DeviceGrantType.java"],"commits":["https://github.com/keycloak/keycloak/commit/04e6244c387a1bde86184635a0049537611e3915","https://github.com/keycloak/keycloak/commit/f1e5b7776c42938d0782fd5846346b8f75c815e6"],"basis":"rarely changed file"}]},{"from":"CVE-2024-4540","to":"CVE-2026-9704","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["services/src/main/java/org/keycloak/protocol/oidc/endpoints/request/AuthzEndpointRequestParser.java"],"commits":["https://github.com/keycloak/keycloak/commit/2191cc26ae6deb52eeaf74046027b65804d16fd0","https://github.com/keycloak/keycloak/commit/f1e5b7776c42938d0782fd5846346b8f75c815e6"],"basis":"shared function","functions":["AuthzEndpointRequestParser"]}]},{"from":"CVE-2026-1486","to":"CVE-2026-9704","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["services/src/main/java/org/keycloak/protocol/oidc/grants/JWTAuthorizationGrantType.java"],"commits":["https://github.com/keycloak/keycloak/commit/176dc8902ce552056d3648c4601d519afc6fb043","https://github.com/keycloak/keycloak/commit/8316e8538f0037d9f998181e73122cff93a94035","https://github.com/keycloak/keycloak/commit/f1e5b7776c42938d0782fd5846346b8f75c815e6"],"basis":"rarely changed file"}]},{"from":"CVE-2026-37977","to":"CVE-2026-9704","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["services/src/main/java/org/keycloak/protocol/oidc/grants/PermissionGrantType.java"],"commits":["https://github.com/keycloak/keycloak/commit/1439bd58a9f25b0d28d0400015f49f35f227ce04","https://github.com/keycloak/keycloak/commit/461ce79a6cd6bfef7ca7fa41da287a3127f47ae4","https://github.com/keycloak/keycloak/commit/f1e5b7776c42938d0782fd5846346b8f75c815e6"],"basis":"rarely changed file"}]}],"packageHistory":[{"cve":"CVE-2026-0871","published":"2026-02-27","fixed":"26.5.2","kev":false},{"cve":"CVE-2026-2603","published":"2026-03-18","fixed":"26.5.5","kev":false},{"cve":"CVE-2026-3190","published":"2026-03-26","fixed":"26.5.6","kev":false,"link":{"from":"CVE-2026-3190","to":"CVE-2026-9704","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Maven:org.keycloak:keycloak-server-spi-private","fromFixed":"26.5.6","toFixed":"26.6.3","daysApart":62}]}},{"cve":"CVE-2026-9704","published":"2026-05-27","fixed":"26.6.3","kev":false},{"cve":"CVE-2026-9791","published":"2026-05-28","fixed":"26.6.3","kev":false}],"package":"Maven:org.keycloak:keycloak-server-spi-private"}}