Extend private-IP guard to 6to4/Teredo addresses - #6249
Merged
Conversation
The SSRF guard already decoded NAT64-embedded IPv4 targets but treated 6to4 and Teredo - two other IPv6 transition address families that also embed an IPv4 destination - as ordinary public addresses. Decode 6to4 the same way as NAT64, recursing into the classifier on the embedded IPv4. Block Teredo wholesale instead, since its embedded IPv4 is obfuscated via bitwise NOT and can't be reliably decoded from the address alone. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
ChrisJBurns
requested review from
JAORMX,
amirejaz,
blkt,
jhrozek and
rdimitrov
as code owners
August 10, 2026 15:12
JAORMX
approved these changes
Aug 10, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6249 +/- ##
==========================================
+ Coverage 72.70% 72.77% +0.06%
==========================================
Files 742 742
Lines 77273 77281 +8
==========================================
+ Hits 56184 56238 +54
+ Misses 17131 17066 -65
- Partials 3958 3977 +19 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
2002::/16) is now decoded the same way as NAT64: the embedded IPv4 is extracted and recursively classified, so a 6to4 address encoding a private/loopback/link-local IPv4 is now treated as private, while one encoding a genuinely public IPv4 stays allowed.2001::/32) is blocked wholesale instead of decoded, since its embedded IPv4 is obfuscated via bitwise NOT and can't be reliably decoded from the address alone.Type of change
Test plan
task test)task lint-fix)Does this introduce a user-facing change?
No.
Special notes for reviewers
/96NAT64 remainder, Teredo) are blocked wholesale.task testsuite surfaces pre-existing, unrelated failures inpkg/plugins/pluginsvcand a git-resolver test — confirmed via testing againstmaindirectly that these predate this change and are environment-dependent, not a regression from this PR.Generated with Claude Code