Fix RP ID validation to process PSL wildcard and exception rules#280
Merged
dainnilsson merged 1 commit intoYubico:mainfrom Mar 10, 2026
Merged
Fix RP ID validation to process PSL wildcard and exception rules#280dainnilsson merged 1 commit intoYubico:mainfrom
dainnilsson merged 1 commit intoYubico:mainfrom
Conversation
Contributor
Author
|
I found this library cannot parse these kinds of psl so I fixed it. python-fido2/fido2/public_suffix_list.dat Line 331 in da779ab python-fido2/fido2/public_suffix_list.dat Line 773 in da779ab |
Member
|
Thanks! |
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.
Summary
verify_rp_id()infido2/rpid.pyis intended to prevent public suffixes from being used as RP IDs. However, it does not process the 160 wildcard rules or 8 exception rules in the bundled public suffix list.Bug
The PSL contains entries like
*.bd(meaning anyX.bdis a public suffix) and!www.ck(exception:www.ckis NOT a public suffix despite the*.ckwildcard). The current code loads these as literal strings and only checks exact membership:Impact
An attacker controlling
evil.example.bdcan set RP ID toexample.bd(a public suffix under the*.bdrule). This is equivalent to usingcomas an RP ID — it allows one tenant of a shared domain space to claim the entire parent domain.Affected: 160 wildcard TLDs including
.bd,.ck,.er,.fk,.jm,.np,.mm,.pg,.nom.br,.sch.uk, and 7 Japanese city domains (*.kawasaki.jp,*.yokohama.jp,*.kobe.jp,*.nagoya.jp,*.sapporo.jp,*.sendai.jp,*.kitakyushu.jp).Fix
Parse wildcard (
*.X) and exception (!X) entries into separate sets, and implement the standard PSL matching algorithm:The
suffixeslist is preserved for backward compatibility.PoC
Spec Reference