fix(deps): bump publicsuffix to 2.3 to drop vulnerable idna 0.2.3#214
Open
AlfioEmanueleFresta wants to merge 1 commit into
Open
fix(deps): bump publicsuffix to 2.3 to drop vulnerable idna 0.2.3#214AlfioEmanueleFresta wants to merge 1 commit into
AlfioEmanueleFresta wants to merge 1 commit into
Conversation
publicsuffix 1.5 transitively pulls idna 0.2.3, which is affected by CVE-2024-12224 (GHSA-h97m-ww89-6jmq). publicsuffix 2.3 depends on idna 1.0+, which is patched. Closes Dependabot alert #25. The 2.x API replaces List::from_str / parse_domain / Domain::root with str::parse and the Psl trait's suffix() / domain() methods. The new algorithm also applies an implicit wildcard so unlisted TLDs (like "localhost") report themselves as a suffix; filter on Suffix::is_known() to preserve v1 semantics and keep bare "localhost" valid as an rp.id.
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.
Fixes Dependabot alert #25 (CVE-2024-12224 / GHSA-h97m-ww89-6jmq / RUSTSEC-2024-0421).
What
publicsuffix = "1.5"transitively pullsidna 0.2.3, which accepts Punycode labels that decode to no non-ASCII output. That allowsexample.organdxn--example-.orgto compare equal after IDNA normalisation, which is unsafe when host comparison is part of a privilege check.publicsuffix 2.3depends onidna ^1.0(patched). After this bump the onlyidnainCargo.lockis1.1.0.API adjustments
publicsuffix2.x is a different crate API. The change is contained tolibwebauthn/src/ops/webauthn/psl.rs:List::from_str(&data)->data.parse::<List>().list.parse_domain(host).ok()?.root()->Psl::domain(host.as_bytes())returning the registrable domain directly.domain.suffix()->Psl::suffix(host.as_bytes()).Suffix::is_known()filterpublicsuffix2.x applies an implicit-wildcard rule that treats any unlisted label as its own public suffix. With the system PSL.dat, that means:public_suffix("localhost") = None,public_suffix("sub.localhost") = Nonepublic_suffix("localhost") = Some("localhost")(withSuffix::is_known() == false)If we surface the implicit-wildcard suffix through the
PublicSuffixListtrait,is_registrable_domain_suffix_or_equal("localhost", "sub.localhost", ...)would rejectlocalhostrp.ids (added in da9c709). The new impl filters onSuffix::is_known()so only PSL-listed suffixes flow through, preserving v1 semantics.Smoke-tested against
/usr/share/publicsuffix/public_suffix_list.dat:Test plan
cargo build --workspace --all-targets --all-featurescargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features -- -D warningscargo test --workspace(171 unit + integration tests pass)cargo publish --dry-run -p libwebauthncargo tree -i idnashows onlyidna 1.1.0;idna 0.2.3is gone