fix(security): block NAT64/6to4/Teredo IPv6 addresses embedding private IPv4 in SSRF guard#995
Open
ital0 wants to merge 2 commits into
Open
fix(security): block NAT64/6to4/Teredo IPv6 addresses embedding private IPv4 in SSRF guard#995ital0 wants to merge 2 commits into
ital0 wants to merge 2 commits into
Conversation
…te IPv4 in SSRF guard
Semgrep Security ScanNo security issues found. |
|
Preview environment deployed 🚀
Stack: Auto-destroys on PR close/merge. Login via the bundled Keycloak realm — |
PR Metrics
Updated Thu, 18 Jun 2026 21:26:48 GMT · run #1954 |
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.
Note
Medium Risk
Changes security-critical outbound fetch validation used by link preview; behavior is tightened with tests, but misclassification of NAT64/public embeds could break legitimate DNS64 fetches.
Overview
Extends
isPrivateAddressinurl-validation.tswithembeddedIpv4, so IPv6 transition forms (NAT6464:ff9b::/96, 6to4, RFC6145, Teredo) are treated as private when the embedded IPv4 is internal—while still allowing NAT64/DNS64 addresses that wrap public IPv4.Adds broad SSRF regression tests: alternate IPv4 encodings, bracketed IPv6 literals, userinfo decoys, DNS rebinding and NAT64 AAAA cases for
validateAndPin/createSafeFetch, plusPOST /v1/previewe2e checks that the advisory path-style route is absent and loopback/rebind targets are blocked without caching leaked metadata.Reviewed by Cursor Bugbot for commit 9c6e480. Bugbot is set up for automated code reviews on this repo. Configure here.