CVE-2026-96547: Keycloak-services: keycloak-services: dcr registration-time claim-path gap allows forging realm_access.roles
A flaw was found in Keycloak Dynamic Client Registration (DCR) within the org.keycloak.services.clientregistration.policy package. The client registration policy validates allowed mapper types but fails to restrict the claim.name value during the registration process. An attacker possessing a valid Initial Access Token (IAT) can register a new client configured with an oidc-usermodel-attribute-mapper that maps a user-editable profile field, such as firstName, directly to the realmaccess.roles claim. When a user subsequently authenticates through this client, the mapper injects the attacker-controlled field value into the realmaccess.roles claim of the issued token. This allows an attacker to forge or corrupt the realm roles claim in tokens provided to external relying parties. While Keycloak internal authorization and the Admin REST API are unaffected because they evaluate the user role model directly, external applications relying on the realmaccess.roles claim for access control are vulnerable to privilege escalation.
Other sources
A flaw was found in the Dynamic Client Registration component of Keycloak, an open-source identity and access management solution. The issue occurs because the system does not properly restrict which claim names can be used when setting up new clients. An attacker with valid registration credentials could create a client that incorrectly maps standard user profile information to sensitive security roles, potentially allowing them to gain unauthorized privileges on external applications that trust Keycloak tokens.
— MITRE
Affected Software
Event History
Frequently Asked Questions
Who can exploit this issue?
An attacker needs a valid Initial Access Token to register a new client through Dynamic Client Registration. They can configure an oidc-usermodel-attribute-mapper that maps a user-editable profile field, such as firstName, to realm_access.roles.
Which systems are at risk of privilege escalation?
External relying-party applications that use the realm_access.roles token claim for access control are at risk. Keycloak internal authorization and the Admin REST API are not affected because they evaluate the user role model directly.
How can I determine whether my deployment is exposed?
Review clients registered through Dynamic Client Registration for oidc-usermodel-attribute-mapper configurations that write user-editable attributes to realm_access.roles. Exposure exists where tokens from those clients are accepted by external applications that authorize users based on that claim.