Skip to content

Make sure internal claims are filtered out from claim_token and claims from tickets have precedence - #51425

Open
pedroigor wants to merge 1 commit into
keycloak:mainfrom
pedroigor:issue-51379
Open

Make sure internal claims are filtered out from claim_token and claims from tickets have precedence#51425
pedroigor wants to merge 1 commit into
keycloak:mainfrom
pedroigor:issue-51379

Conversation

@pedroigor

Copy link
Copy Markdown
Contributor

Closes #51379

Copilot AI balanced review requested due to automatic review settings August 4, 2026 13:35
@pedroigor
pedroigor requested review from a team as code owners August 4, 2026 13:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Hardens UMA claim handling against internal-claim spoofing and ensures ticket claims take precedence.

Changes:

  • Filters untrusted kc.* claims.
  • Merges claims with ticket precedence.
  • Adds security and precedence regression tests.

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
EntitlementAPITest.java Adds UMA claim security tests.
PolicyProviderFactory Registers the test policy provider.
ClaimAttributePolicyProvider.java Adds claim-based test policy support.
DefaultEvaluationContext.java Initializes and filters context attributes.
AuthorizationTokenService.java Refactors claim handling and precedence.

@pedroigor pedroigor changed the title Make sure interal claims are filtered out froclaim_token and claims from tickets have precedence Make sure interal claims are filtered out from claim_token and claims from tickets have precedence Aug 4, 2026
Copilot AI review requested due to automatic review settings August 4, 2026 14:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

Suppressed comments (1)

testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/authorization/ClaimAttributePolicyProvider.java:16

  • testsuite/DEPRECATED.md:12 permits adding bug-fix cases to existing tests but explicitly disallows new files in the deprecated testsuite. Please implement this assertion by extending/reusing an existing provider, or move the regression coverage to the new Test Framework rather than adding this provider file.
public class ClaimAttributePolicyProvider implements PolicyProviderFactory<PolicyRepresentation>, PolicyProvider {

@pedroigor pedroigor changed the title Make sure interal claims are filtered out from claim_token and claims from tickets have precedence Make sure internal claims are filtered out from claim_token and claims from tickets have precedence Aug 6, 2026
rmartinc
rmartinc previously approved these changes Aug 6, 2026
@pedroigor
pedroigor enabled auto-merge (rebase) August 6, 2026 18:55
… from tickets have precedence

Closes keycloak#51379

Signed-off-by: Pedro Igor <pigor.craveiro@gmail.com>
Copilot AI review requested due to automatic review settings August 10, 2026 13:16
@stianst stianst self-assigned this Aug 10, 2026
@stianst
stianst disabled auto-merge August 10, 2026 13:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

Suppressed comments (1)

testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/authorization/ClaimAttributePolicyProvider.java:1

  • This adds a new file under the deprecated Arquillian testsuite, which testsuite/DEPRECATED.md:12 explicitly prohibits. Move this regression coverage and its policy provider to the new test framework under tests/, or reuse an existing provider without adding a testsuite file.
package org.keycloak.testsuite.authorization;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CVE-2026-18572] UMA claim token can override the authorization time-policy clock

5 participants