REDHAT-BUG-2577542: Medium severity Red Hat Keycloak vulnerability
Keycloak Authorization Services can resolve a requested URI to an
unrelated protected resource when that resource uses an extension suffix wildcard pattern such as /public/.json. The URI matcher compares the request only against the file extension suffix (e.g., .json), omitting the configured path prefix (e.g., /public/). A suffix match is also retained and preferred over a normal trailing-wildcard candidate. Consequently, a UMA permission request for /admin/secret.json can match against the /public/.json resource and receive its grant policy instead of the deny policy attached to /admin/. When using responsemode=decision, the authorization endpoint returns a positive decision for the denied URI, defeating resource-level authorization for affected configurations.
Affected Software
Event History
Frequently Asked Questions
Which authorization configurations are exposed?
Configurations that use extension suffix wildcard resource patterns, such as /public/*.json, are affected when another protected URI has a different policy, such as a deny policy on /admin/*. The incorrect match can cause the extension-based resource policy to be used for an unrelated path.
What does an attacker need to request to trigger the issue?
The attacker needs to make a UMA permission request for a URI whose filename extension matches an extension wildcard resource. For example, a request for /admin/secret.json can match a resource configured as /public/*.json.
When can the authorization endpoint return an incorrect allow decision?
The issue produces a positive authorization decision when response_mode=decision is used and the requested URI matches an extension suffix wildcard resource. This can override the deny policy that would otherwise apply to the requested path.