Skip to content

security(core): reject the RFC 8215 local-use NAT64 prefix in the SSRF filter - #7959

Open
ar2rsawseen wants to merge 1 commit into
masterfrom
security/ssrf-nat64-local-use
Open

security(core): reject the RFC 8215 local-use NAT64 prefix in the SSRF filter#7959
ar2rsawseen wants to merge 1 commit into
masterfrom
security/ssrf-nat64-local-use

Conversation

@ar2rsawseen

Copy link
Copy Markdown
Member

api/utils/ssrf-protection.js isBlockedIP admits only ipaddr.js unicast addresses and relies on ipaddr.js to classify NAT64 as non-public. ipaddr.js@1.9.1 reports the well-known NAT64 prefix (64:ff9b::/96) as rfc6052 (rejected by the unicast check) but the RFC 8215 local-use NAT64 prefix (64:ff9b:1::/48) as generic unicast, so it was accepted.

This adds an explicit check to reject 64:ff9b:1::/48, matching the module's existing NAT64 handling and documented intent. Network-specific NAT64 prefixes carved from an operator's own global-unicast space cannot be distinguished by prefix and remain out of scope; the connect-time routing requirement bounds the residual.

This is the shared core SSRF module, so it applies to both this repo and countly-platform. It mirrors the same change in the MCP server's address classifier (Countly/countly-mcp-server#152).

Tests: two cases added to test/unit-tests/api.utils.ssrf-protection.js (local-use NAT64 rejected; public IPv6 still allowed). Full SSRF suite and eslint green.

🤖 Generated with Claude Code

…F filter

isBlockedIP admits only ipaddr.js 'unicast' addresses and relies on ipaddr.js to
classify NAT64 as non-public. ipaddr.js@1.9.1 reports the well-known NAT64 prefix
(64:ff9b::/96) as 'rfc6052' but the RFC 8215 local-use prefix (64:ff9b:1::/48) as
generic unicast, so add an explicit check to reject that prefix, matching the
existing NAT64 handling. Network-specific NAT64 prefixes carved from an operator's
own unicast space cannot be distinguished by prefix and remain out of scope.

Mirrors the same change in the MCP server's address classifier. Adds unit tests
for 64:ff9b:1::7f00:1.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant