Skip to content

Improve validation of "jku" claim (8.x)#3481

Merged
kllysng merged 2 commits into
AzureAD:dev8xfrom
alexholub113:alexholub/improve-validation-of-jku-claim-8x
May 19, 2026
Merged

Improve validation of "jku" claim (8.x)#3481
kllysng merged 2 commits into
AzureAD:dev8xfrom
alexholub113:alexholub/improve-validation-of-jku-claim-8x

Conversation

@alexholub113
Copy link
Copy Markdown
Contributor

Currently, when validating the "jku" claim against the list from AllowedDomainsForJkuRetrieval we use Host.EndsWith for the string comparison, allowing invalid domains like "wrongcontoso.com" to bypass restrictions intended for "contoso.com"

This PR improves the validation by updating the domain matching to require either:

  • An exact match
  • A proper subdomain (dot-bounded) match

This is a cherry-pick of commit 6cec324 from dev to dev8x.

Files changed:

  • src/Microsoft.IdentityModel.Protocols.SignedHttpRequest/SignedHttpRequestHandler.cs
  • test/Microsoft.IdentityModel.Protocols.SignedHttpRequest.Tests/PopKeyResolvingTests.cs

@alexholub113 alexholub113 requested a review from kllysng May 8, 2026 23:07
@alexholub113 alexholub113 self-assigned this May 8, 2026
@alexholub113 alexholub113 requested a review from a team as a code owner May 8, 2026 23:07
@kllysng kllysng merged commit 95e9ff0 into AzureAD:dev8x May 19, 2026
2 checks passed
This was referenced Jun 2, 2026
This was referenced Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants