REDHAT-BUG-2508308: Medium severity Keycloak Google Identity Provider vulnerability
A Missing Authorization vulnerability was identified in Keycloak Google Identity Provider implementation. The flaw exists in the external access-token exchange code path, which is used when the Token Exchange V1 feature is enabled. While the standard Google ID-token login flow correctly validates the hd hosted domain claim against the configured hostedDomain setting, the access-token exchange flow skips this validation. When an external access token is provided, Keycloak retrieves the user profile from the Google user-info endpoint but fails to verify that the domain associated with the user matches the restricted domain configured in the Identity Provider settings. An attacker with a valid Google access token for any domain can exploit this flaw if they have access to a confidential client authorized to perform token exchange. Successful exploitation allows the attacker to bypass domain restrictions, obtain a Keycloak access token, and potentially create or link a brokered identity that should have been restricted.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Disable the Token Exchange V1 feature in Keycloak so the external access-token exchange code path (used for access-token exchange) is not reachable.
Keycloak Google Identity Provider (external access-token exchange / Token Exchange V1) Token Exchange V1 feature = disable - Configuration
Ensure Keycloak validates that the domain (hosted domain) associated with the Google user profile returned from the user-info endpoint matches the restricted/hosted domain configured in the Identity Provider settings (the access-token exchange flow currently skips this validation).
Keycloak Google Identity Provider Identity Provider restricted domain verification = required
Event History
Frequently Asked Questions
What is the severity of REDHAT-BUG-2508308?
The severity of REDHAT-BUG-2508308 is medium, with a score of 4.
What is the risk associated with REDHAT-BUG-2508308?
REDHAT-BUG-2508308 has a risk rating of 19.
How do I fix REDHAT-BUG-2508308?
To address REDHAT-BUG-2508308, ensure that the Token Exchange V1 feature is properly configured and managed.
What impact does REDHAT-BUG-2508308 have on Keycloak?
REDHAT-BUG-2508308 can lead to unauthorized access due to a missing authorization check in the Google Identity Provider.
What component of Keycloak is affected by REDHAT-BUG-2508308?
REDHAT-BUG-2508308 affects the Google Identity Provider implementation in Keycloak.