Skip to content

fix(search): block IPv4-mapped and NAT64 SSRF literals - #62

Merged
thegeorgepu merged 3 commits into
mainfrom
codex/issue-60-nat64-mapped-ipv6
Sep 5, 2026
Merged

fix(search): block IPv4-mapped and NAT64 SSRF literals#62
thegeorgepu merged 3 commits into
mainfrom
codex/issue-60-nat64-mapped-ipv6

Conversation

@thegeorgepu

Copy link
Copy Markdown
Contributor

Summary

  • classify canonical IPv4-mapped IPv6 literals before web_fetch
  • classify NAT64 /96 embeddings, including single-group tails, without shifting the embedded IPv4 value
  • fail closed for malformed recognized prefixes and reject out-of-range dotted octets
  • register the focused SSRF suite in the canonical test harness, with a pin that requires one executable registration line

This is a narrow repair for finding 1 in #60. Redirect-per-hop and DNS-policy work remain outside this PR.

Evidence

  • exact candidate: 8f8e321f4def104aac2d7dfec8679a4b5dd152e4
  • tree: f77d74c89bae0dbcae473d821453a9108ede7af4
  • focused production-import suite: 54/54 pass
  • current main with the candidate tests: 25 intended failures
  • original worker candidate with the expanded tests: 19 intended failures
  • wrong single-group NAT64 mutation: 6 intended failures
  • malformed recognized-prefix fail-open mutation: 12 intended failures
  • test-registration removal/comment/substring mutations: all fail
  • independent local review: GO on the exact clean head/tree

The broader package check could not be claimed locally because the borrowed dependency tree did not contain the repository's tsgo/Vitest type dependencies. This draft intentionally relies on the repository's natural CI for the full dependency-backed check before promotion.

Review checklist

  • Negative cases reach the intended address-classification mechanism rather than passing through an earlier refusal.
  • Positive public IPv4/IPv6 controls remain reachable.
  • Tests import the production extension and are wired into the installed canonical harness.
  • Missing, malformed, range-invalid, mapped, and NAT64 variants are covered.
  • Old behavior and targeted defect restorations fail the intended assertions.

Closes the IPv4-mapped/NAT64 portion of #60; does not close the redirect finding.

@thegeorgepu
thegeorgepu marked this pull request as ready for review September 5, 2026 15:09
@thegeorgepu
thegeorgepu merged commit e659ebd into main Sep 5, 2026
10 checks passed
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