Skip to content

fix(methods): refuse IPv6 benchmarking and documentation ranges - #191

Merged
daniel-mader merged 1 commit into
mainfrom
claude/tender-rubin-2api7k-ipv6-special-ranges
Nov 19, 2026
Merged

daniel-mader merged 1 commit into
mainfrom
claude/tender-rubin-2api7k-ipv6-special-ranges

Conversation

@daniel-mader

@daniel-mader daniel-mader commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

What and why

is_public in methods::web::client decides which addresses ReqwestClient may connect to. It checks both the addresses the PublicAddresses resolver returns for a host name and the IP literals that get refuses. 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:
    • refuses both ends of each range: 2001:2::1, 2001:2:0:ffff::1, 3fff::1, 3fff:fff:ffff::1;
    • still accepts the near misses just outside them: 2001:2:1::1, 2001:3::1, 3fff:1000::1.
  • cargo test --all-features --locked: 772 passed.
  • cargo fmt --all --check and RUSTDOCFLAGS="-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 on main, in src/resolver/jwks.rs and tests/sd_jwt_vc.rs.

Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • IPv6 addresses in the 3fff::/20 documentation range and 2001:2::/48 benchmarking range are now classified as non-public.
  • Documentation
    • Clarified that public-address checks exclude otherwise reserved addresses.

`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
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The is_public description and IPv6 filtering logic now include the 3fff::/20 and 2001:2::/48 ranges. Tests cover addresses within and near these ranges.

Changes: IPv6 public-address filtering

Layer / File(s) Summary
Update IPv6 filtering and test coverage
src/methods/web/client.rs
is_public now rejects IPv6 addresses in the 3fff::/20 and 2001:2::/48 ranges. Tests cover addresses within and near these ranges. The documentation now includes otherwise reserved addresses.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · up to 1bc02

This change makes the web client refuse two additional IPv6 ranges that are not globally reachable. It is narrowly scoped and tested at the range boundaries, and no merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: the PR makes the client refuse the IPv6 benchmarking range (2001:2::/48) and documentation range (3fff::/20) when classifying addresses as public. The raw summary conf…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the PR makes the client refuse the IPv6 benchmarking range (2001:2::/48) and documentation range (3fff::/20) when classifying addresses as public. The raw summary confirms the is_public filter adds both ranges, and the objectives state the same intent. The conventional-commit prefix 'fix(methods):' matches the touched module, methods::web::client.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 3306b43 and 1bc020b.

Files selected for processing: 1

  • src/methods/web/client.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@codecov

codecov Bot commented Nov 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@daniel-mader
daniel-mader merged commit 3d4e829 into main Nov 19, 2026
35 checks passed
@daniel-mader
daniel-mader deleted the claude/tender-rubin-2api7k-ipv6-special-ranges branch November 19, 2026 16:03
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