Skip to content

Fix RP ID domain validation to require dot boundary#92

Merged
Progdrasil merged 1 commit into
mainfrom
max/fix-rp-id-suffix-validation
Mar 30, 2026
Merged

Fix RP ID domain validation to require dot boundary#92
Progdrasil merged 1 commit into
mainfrom
max/fix-rp-id-suffix-validation

Conversation

@Vogeltak

Copy link
Copy Markdown
Collaborator

The ends_with() check allowed attacker-controlled origins like evil-example.com to pass validation for RP ID example.com. This violates the W3C "is a registrable domain suffix of or is equal to" algorithm which requires a dot-prefixed suffix match. Replaced all three occurrences with a proper check that requires either an exact match or a dot-separated suffix.

@Vogeltak Vogeltak requested a review from Progdrasil March 30, 2026 08:32
@Vogeltak Vogeltak self-assigned this Mar 30, 2026
The `ends_with()` check allowed attacker-controlled origins like
`evil-example.com` to pass validation for RP ID `example.com`. This
violates the W3C "is a registrable domain suffix of or is equal to"
algorithm which requires a dot-prefixed suffix match. Replaced all three
occurrences with a proper check that requires either an exact match or a
dot-separated suffix.
@Vogeltak Vogeltak force-pushed the max/fix-rp-id-suffix-validation branch from b2984e6 to 6f7936d Compare March 30, 2026 08:37
@Progdrasil Progdrasil merged commit c3c694d into main Mar 30, 2026
8 checks passed
@Progdrasil Progdrasil deleted the max/fix-rp-id-suffix-validation branch March 30, 2026 15:22
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.

2 participants