Skip to content

fix: block local-use NAT64 embeddings of private IPv4 addresses - #190

Draft
cursor[bot] wants to merge 6 commits into
masterfrom
fix/critical-bug-management-fe50
Draft

cursor[bot] wants to merge 6 commits into
masterfrom
fix/critical-bug-management-fe50

Conversation

@cursor

@cursor cursor Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

The SSRF check rejects private IPv4 addresses embedded in the well-known NAT64 prefix 64:ff9b::/96, but it allows the local-use prefix 64:ff9b:1::/48 (RFC 8215). On a network that translates that prefix, a lookup or redirect to an address such as 64:ff9b:1:a9fe:a9:fe00:: is delivered to 169.254.169.254. The same path reaches 10.0.0.1, 127.0.0.1, and other blocked IPv4 ranges.

RFC 6052 places the IPv4 address around the reserved octet for a /48 prefix, so it is not in the last 32 bits the way 64:ff9b::/96 embeddings are. A non-zero suffix is still translated, so those forms are blocked too. Public embeddings such as 64:ff9b:1:808:8:800:: (8.8.8.8) stay allowed.

Test plan

  • bunx eslint src/webfinger.ts src/webfinger.test.ts
  • bunx tsc --project tsconfig.dev.json --noEmit
  • bun test ./src/webfinger.test.ts
  • bun test ./spec/integration/local-server.integration.ts
  • Direct lookups of private local-use NAT64 literals are rejected before fetch
  • A redirect to http://[64:ff9b:1:a9fe:a9:fe00::]/latest/meta-data/ is rejected and not followed
Open in Web View Automation 

cursoragent and others added 6 commits October 7, 2026 14:36
dns.resolve4/resolve6 ignore /etc/hosts while fetch connects through
getaddrinfo. Names such as ip6-localhost therefore skipped the private
address check and opened a connection to ::1. Also consult dns.lookup,
which uses the same system resolver as fetch.

Co-authored-by: Nick Jennings <silverbucket@users.noreply.github.com>
Resolve JSDoc conflict in validateDNSResolution by combining the
hosts-file SSRF fix description with master's DNS-based wording.
Fix broken Node.js docs link in SECURITY.md (unversioned /api/ URL
now 404s).

Co-authored-by: Nick Jennings <silverbucket@users.noreply.github.com>
Cherry-pick the DNS-vs-hosts disagreement test from #183, tighten the
existing hosts-file test with fetchCalled and a specific error message,
and expand JSDoc/SECURITY.md to document NSS and hosts-file overrides.

Co-authored-by: Nick Jennings <silverbucket@users.noreply.github.com>
Co-authored-by: Nick Jennings <silverbucket@users.noreply.github.com>
The SSRF check handled the well-known NAT64 prefix 64:ff9b::/96 but
not the RFC 8215 local-use prefix 64:ff9b:1::/48. On a network that
translates that prefix, an embedded private IPv4 address such as
169.254.169.254 is delivered to that IPv4 host. The /48 layout places
the IPv4 address around the reserved octet, not in the last 32 bits.

Co-authored-by: Nick Jennings <silverbucket@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Oct 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 12502b7e-5471-4578-ac59-dc87d2c600a4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · 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

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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