Keycloak 26.7.1 Bug: OAuth Metadata-Provisioned Clients Skip PKCE and Scope Inheritance
A security gap in Keycloak 26.7.1 causes clients auto-provisioned via the OAuth Client ID Metadata Document (CIMD) feature to bypass PKCE enforcement, accepting both plain challenges and requests with no code_challenge at all. The provisioned clients also lack basic scopes, audience mappers, and realm capability scopes because the CIMD executor only sets three attributes — consent-related ones — with no PKCE configuration included. The root cause is an inheritance gap: hand-authored clients carry PKCE settings in their own JSON, but auto-provisioned clients only receive what the executor explicitly assigns. Keycloak's Server Administration Guide does warn that client policy conditions may not always evaluate as expected and advises testing, but the separate MCP setup guide that enables this feature contains no such warning. The fix is straightforward — adding Keycloak's built-in pkce-enforcer executor to the existing client profile ensures provisioned clients are also pinned to S256.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.



Discussion (0)
Log in to join the discussion and vote.
Log in