[ENG-4057] Classify more non-public addresses and keep fetch options across redirects - #296
Merged
Merged
Conversation
…redirects internal_host now treats the IPv4 multicast, reserved, benchmarking and IETF protocol blocks as non-public, along with IPv6 site-local and multicast space. IPv6 transition addresses (NAT64 and 6to4) are classified by the IPv4 destination they carry. When the guard follows redirects on the caller's behalf, every hop is sent with the caller's own fetch options, and the final response reports that it was redirected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Well-structured egress guard enhancement with comprehensive internal-address classification. 🎯 Quality: 100% Elite · 📦 Size: Medium 📈 This month: Your 148th PR — above team average · Averaging Excellent |
Contributor
Author
|
/review |
devlob
approved these changes
Sep 29, 2026
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.
Two changes to outbound request screening.
Non-public address space.
internal_hostnow also treats these as non-public:224.0.0.0/4), reserved space (240.0.0.0/4, including the broadcast address), benchmarking (198.18.0.0/15) and the IETF protocol block (192.0.0.0/24);fec0::/10) and multicast (ff00::/8).IPv6 transition addresses are classified by the IPv4 address they carry: NAT64
64:ff9b::/96and 6to42002::/16. The NAT64 local-use prefix64:ff9b:1::/48is always non-public. A NAT64 or 6to4 address that carries a public IPv4 address stays public.Redirects. When the guard follows redirects on the caller's behalf, every hop is now sent with the caller's own fetch options, such as a custom dispatcher,
keepaliveor referrer policy. The final response reportsredirected: true, as native redirect following does. A streamed request body is still sent once, with the first hop.Tests pair each range with its nearest public neighbour, so an off-by-one boundary fails. They cover the redirect behaviour with a stubbed transport and with a real local server and dispatcher.
Validation: full suite (3,427 passed, 7 skipped), typecheck and build.
Refs ENG-4057
🤖 Generated with Claude Code