Repository navigation
[CVE-2026-16089] Authorization codes can be retargeted to another cli… - #52062
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Binds authorization codes to their originating client UUID, preventing code retargeting.
Changes:
- Persist and validate the originating client UUID.
- Add a regression test for CVE-2026-16089.
- Remove obsolete OID4VC test code and constructor.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
OID4VCIssuerEndpointTest.java |
Removes unused helper code. |
AuthorizationCodeTest.java |
Tests rejection of retargeted codes. |
OAuth2CodeParser.java |
Validates client binding. |
OAuth2Code.java |
Serializes the client UUID. |
OIDCLoginProtocol.java |
Records the originating client UUID. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| // We allow "persistedClientUUID" to be null just because zero-downtime upgrade between micro versions (as older KC versions might not have clientUUID stored). | ||
| // This might be removed in the future version | ||
| if (persistedClientUUID != null && !clientUUID.equals(persistedClientUUID)) { | ||
| logger.warnf("Code '%s' is bound to a different client", clientUUID); |
…ent session closes keycloak#51003 Signed-off-by: mposolda <mposolda@gmail.com>
mposolda
force-pushed
the
51003-authz-code-retarget
branch
from
August 26, 2026 12:59
684e2f7 to
e745c21
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
services/src/main/java/org/keycloak/protocol/oidc/utils/OAuth2CodeParser.java:119
- This warning reports the supplied client UUID as the client to which the code is bound, even though the condition proves the opposite. Reword it so security diagnostics do not misidentify the bound client.
logger.warnf("Code is bound to a different client '%s'", clientUUID);
Comment on lines
+116
to
+118
| // We allow "persistedClientUUID" to be null just because zero-downtime upgrade between micro versions (as older KC versions might not have clientUUID stored). | ||
| // This might be removed in the future version | ||
| if (persistedClientUUID != null && !clientUUID.equals(persistedClientUUID)) { |
graziang
approved these changes
Aug 26, 2026
Contributor
Author
|
@graziang Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ent session
closes #51003
Besides the fix, there is minor code cleanup to removed unused method in
OID4VCIssuerEndpointTestand then unused constructor onOAuth2Code