Back

HIGH

Keycloak: keycloak: privilege escalation due to oversized subject_token jwt

Published May 27, 2026

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

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.

Weaknesses (1)

References (13)

Change history (0)

No recorded changes yet.

Sources

CVE.org / MITRE

Status PUBLISHED
Assigner redhat
Published May 27, 2026
Updated Jun 26, 2026
Reserved May 27, 2026

CISA Vulnrichment

Updated May 27, 2026

NVD

Status Modified
Modified Jun 26, 2026

Red Hat

Severity Moderate
Public date May 27, 2026
Bugzilla 2481877

ENISA EUVD

Assigner redhat
Published May 27, 2026
Updated Jun 26, 2026