REDHAT-BUG-2496889: Medium severity Keycloak Keycloak vulnerability
A write-path authorization bypass vulnerability exists in the ClientResource.addDefaultClientScope() and related endpoints in Keycloak when adminPermissionsEnabled is set to true (FGAP v2). The flaw stems from insufficient permission validation: the code only verifies that the caller has manage permissions on the target client but fails to check if the caller has any permissions (such as view or map) on the client scope being attached. An attacker with a delegated admin role (Clients:view and Clients:manage on at least one client) can exploit this by discovering the UUID of a "hidden" client scope (one they are otherwise restricted from accessing). By calling the client scope assignment endpoints, the attacker can successfully link these hidden scopes to their managed client. Concrete Impact: Unauthorized Claim Injection: Attacker can inject claims from restricted client scopes into end-user access tokens.
Authorization Bypass in Relying Apps: Applications relying on Keycloak token claims for internal authorization decisions may grant unauthorized access based on the injected claims.
Data Exposure: If the hidden scope contains sensitive hardcoded claims or mappers, these are exposed to the end-user and the relying application.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Set Keycloak configuration flag adminPermissionsEnabled to false to address the write-path authorization bypass in ClientResource.addDefaultClientScope() and related endpoints (FGAP v2), which occurs when adminPermissionsEnabled is true.
Keycloak adminPermissionsEnabled = false - Compensating control
Restrict delegated admin roles so that users cannot have Clients:view and Clients:manage on client resources in Keycloak in environments where the authorization bypass (FGAP v2) is present, since attackers with delegated admin roles can discover hidden client-scope UUIDs and attach them via client scope assignment endpoints.
Event History
Frequently Asked Questions
What is the severity of REDHAT-BUG-2496889?
The severity of REDHAT-BUG-2496889 is medium, rated at 4.
What does REDHAT-BUG-2496889 affect?
REDHAT-BUG-2496889 affects the Keycloak software, specifically in the ClientResource.addDefaultClientScope() and related endpoints.
How does the vulnerability in REDHAT-BUG-2496889 occur?
The vulnerability in REDHAT-BUG-2496889 occurs due to insufficient permission validation when adminPermissionsEnabled is set to true.
What is the impact of REDHAT-BUG-2496889?
The impact of REDHAT-BUG-2496889 is an authorization bypass that can allow potentially unauthorized actions.
How do I fix REDHAT-BUG-2496889?
To fix REDHAT-BUG-2496889, ensure proper permission validation is implemented in the affected endpoints.