CVE-2026-16102: Keycloak-services: keycloak-services: default dcr policy allows role forgery via user property mappers
A flaw was found in Keycloak where the default Dynamic Client Registration (DCR) policy permits the use of User Property mappers without validating the target claim path. While the policy checks the mapper provider type, it does not restrict where the mapper can write data within the resulting token. An attacker with a standard user account and a limited Initial Access Token (IAT) can register a new client and configure User Property mappers (such as firstName or lastName) to target the resourceaccess.realm-management.roles claim path. By setting their user profile properties to administrative role names (e.g., manage-clients, realm-admin), the attacker can produce a forged access token containing these roles. Although recent mitigations (CVE-2026-4629) protect the Admin REST API from such forged tokens, the Client Registration API remains vulnerable because it reads the resourceaccess claim directly during authorization. An attacker can use this bypass to perform unauthorized DCR operations, including reading confidential client secrets, modifying redirect URIs, and impersonating service accounts to achieve full realm compromise.
Other sources
A flaw was found in the Dynamic Client Registration (DCR) component of Keycloak, an identity and access management solution. The default DCR policy fails to properly validate the claim path for User Property mappers, allowing them to write values to sensitive internal claim locations. An attacker with a standard user account and a limited Initial Access Token can exploit this to forge administrative roles in their access token. This allows the attacker to take over other clients, steal confidential secrets, and potentially gain full administrative control over the realm.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Mitigate by preventing use of User Property mappers that can write to sensitive claim paths in the default Dynamic Client Registration (DCR) policy (the policy permits User Property mappers without validating the target claim path, enabling role forgery and unauthorized DCR operations via the resource_access claim).
- Compensating control
Mitigate the vulnerable Dynamic Client Registration (Client Registration API) behavior by ensuring authorization/token handling cannot be abused to read resource_access.claims directly during DCR authorization (the Client Registration API remains vulnerable because it reads resource_access claim directly during authorization).
- Compensating control
Apply the mentioned mitigation for Admin REST API forged tokens (CVE-2026-4629) to reduce impact where applicable, noting that it does not address the vulnerable Client Registration API.
Event History
Frequently Asked Questions
What is the severity of CVE-2026-16102?
The severity of CVE-2026-16102 is rated as high with a score of 8.1.
How do I fix CVE-2026-16102?
To mitigate CVE-2026-16102, ensure that the DCR policy for Keycloak is properly configured to validate claim paths for User Property mappers.
What are the risks associated with CVE-2026-16102?
CVE-2026-16102 poses a risk of role forgery due to improper validation in the Dynamic Client Registration component.
Who is affected by CVE-2026-16102?
CVE-2026-16102 affects users of Keycloak that utilize the Dynamic Client Registration feature with default policy settings.
What type of vulnerability is CVE-2026-16102?
CVE-2026-16102 is a security vulnerability related to improper validation in the handling of User Property mappers in Keycloak.