Fedora Account System
Red Hat Associate
Red Hat Customer
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.