Repository navigation
Conversation
|
A resource URI using an extension-suffix wildcard, such as "/public/.json", was compared only from the '' onward, so it matched any URI with the same extension whatever its prefix. A request for "/admin/secret.json" resolved to the public resource and was evaluated against its policies instead of the ones guarding /admin. The fix:
Resolution is now independent of the order resources are visited in. Both call sites build the matcher's path collection from a Behavior changes worth noting: a path-only suffix pattern no longer matches an absolute target URI, and "/public/.json" no longer matches the bare prefix "/public". Both align suffix patterns with every other pattern kind. The documented bare form is unaffected - "/.html" has prefix "/", so it still matches "/page.html" and "/some/path/report.html". |
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved path-matching specificity defects can select broader authorization resources over more-specific ones, causing the wrong policies to be evaluated.
3 open issues
What changed in this PR
This PR addresses CVE-2026-133537 by tightening Authorization Services URI matching so suffix wildcards respect the full URI pattern rather than just the extension.
Changes:
- Require suffix-wildcard prefixes to match and introduce unified wildcard specificity ranking.
- Add unit and UMA integration regression tests for resource selection and normalized URIs.
- Document matching changes and extend the permission-request test helper.
| File | Description |
|---|---|
tests/utils-shared/src/main/java/org/keycloak/testsuite/util/oauth/PermissionGrantRequest.java |
Corrects the fluent return type and adds arbitrary request parameters. |
tests/base/src/test/java/org/keycloak/tests/authz/services/uma/UmaGrantTypeTest.java |
Adds URI-based permission tests asserting selected resource identities. |
docs/documentation/upgrading/topics/changes/changes-next-cve-2026-133537.adoc |
Explains matching compatibility changes and wildcard precedence. |
docs/documentation/authorization_services/topics/resource-create.adoc |
Documents full-pattern suffix matching and resource selection rules. |
common/src/test/java/org/keycloak/common/util/PathMatcherTest.java |
Adds prefix, authority, normalization, and ordering regression tests. |
common/src/main/java/org/keycloak/common/util/PathMatcher.java |
Enforces suffix prefixes and revises match ranking. |
Review effort: Balanced
1f42d83 to
ea52292
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved URI-matching flaws treat request-supplied parameters as wildcards and let catch-all grants override deny policies, potentially granting permissions outside registered templates.
3 open issues
3 resolved since last review
Review effort: Balanced
ea52292 to
6872d18
Compare
6872d18 to
0428f54
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The path matcher ignores the fewer-parameters tie-break for equal literal prefixes, allowing a broader template’s policies to override the suffix resource’s policies.
1 open issue
3 resolved since last review
Review effort: Balanced
0ef5fb4 to
6c585cf
Compare
There was a problem hiding this comment.
🟡 Changes recommended
A critical path-matching flaw interprets request-supplied parameter values as wildcards, allowing an unrelated resource’s grant to override the protecting resource’s deny policy.
1 open issue
2 resolved since last review
Review effort: Balanced
6c585cf to
c7b8ba7
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
The fix changes authorization precedence across URI pattern types beyond suffix matching, requiring maintainer and security review of compatibility and policy-selection risks.
No open issues 🎉
1 resolved since last review
Review effort: Balanced
…URI prefix Also take the wildcard a template declares from the registered pattern rather than from its resolved form, so a "*" supplied in a request parameter cannot be read back as one the resource declared. Closes CVE-2026-133537 Closes keycloak#55466 Signed-off-by: Stefan Guilhen <sguilhen@redhat.com>
c7b8ba7 to
119c5ca
Compare


…URI prefix
Closes CVE-2026-133537
Closes #55466