Repository navigation
fix(methods): refuse IPv6 benchmarking and documentation ranges - #191
Conversation
`is_public` treated `2001:2::/48` (benchmarking, RFC 5180) and `3fff::/20` (documentation, RFC 9637) as public, so `ReqwestClient` resolved host names into them and fetched IP literals in them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q3mpcYRzr2GH7mEFfrkZDd
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! 🚀 New features to boost your workflow:
|
What and why
is_publicinmethods::web::clientdecides which addressesReqwestClientmay connect to. It checks both the addresses thePublicAddressesresolver returns for a host name and the IP literals thatgetrefuses. It treated two IPv6 special-purpose ranges as public, although IANA marks both as not globally reachable:2001:2::/48, benchmarking (RFC 5180);3fff::/20, documentation (RFC 9637).So a host name resolving into either range, or a URL with such a literal, was fetched. The IPv4 benchmarking range (
198.18.0.0/15) and the older IPv6 documentation prefix (2001:db8::/32) were already refused.Found in the review of impierce/openid4vc#227, whose default client relies on this classification for host names.
How it was tested
public_addresses:2001:2::1,2001:2:0:ffff::1,3fff::1,3fff:fff:ffff::1;2001:2:1::1,2001:3::1,3fff:1000::1.cargo test --all-features --locked: 772 passed.cargo fmt --all --checkandRUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features --locked: clean.cargo clippy --all-targets --all-features --locked -- -D warnings: clean for this change. The local toolchain (rustc 1.97) reports two lints that are already onmain, insrc/resolver/jwks.rsandtests/sd_jwt_vc.rs.Generated by Claude Code
Summary by CodeRabbit
3fff::/20documentation range and2001:2::/48benchmarking range are now classified as non-public.