Post

When IPv4-Mapped IPv6 Isn't Enough: The NAT64 SSRF Bypass in MCP Inspector (GHSA-v2gx-m79c-pvxj)

MCP Inspector's OAuth destination guard blocked IPv4 cloud-metadata addresses and ::ffff:-mapped IPv6, but missed RFC 6052's NAT64 prefix (64:ff9b::/96). Here is how sibling-fix variant hunting found GHSA-v2gx-m79c-pvxj, how the maintainers fixed it structurally, and the Semgrep rule (SS-7) to catch the same blind spot in other egress guards.

When IPv4-Mapped IPv6 Isn't Enough: The NAT64 SSRF Bypass in MCP Inspector (GHSA-v2gx-m79c-pvxj)

On 18 November 2026, my automated vulnerability radar surfaced a high-scoring SSRF lead (score 91) in mcp-server-fetch: an IPv6 address trick using NAT64 that could slip past a cloud-metadata blocklist. Checking GitHub Security Advisories the next morning, it looked like a dead end — mcp-server-fetch had already been patched on 25 October in GHSA-66qx-2266-pmj6.

Most triage loops stop there. Instead, I checked whether other tools in the same MCP ecosystem had written their own IP blocklists and missed the same edge case. One hop over, server-everything had carried the exact same gap and had been patched the day before (GHSA-38j4-j742-j7r3). One hop further sat @modelcontextprotocol/inspector — the official developer tool for testing MCP servers. Its maintainers had recently hardened its outbound request guard against cloud-metadata SSRF (GHSA-fvg8-f358-w2c8, fixed in 2.15.0), but when I checked main, the NAT64 case was still wide open.

Eight days later, on 27 November, the maintainers shipped @modelcontextprotocol/inspector 2.17.0 and 1.0.7 (alongside @modelcontextprotocol/inspector-server 1.0.7) and published GHSA-v2gx-m79c-pvxj. By itself, this is a Low-severity, precondition-bound finding (CWE-918, CVSS 3.1 3.7) that only reaches cloud metadata on networks with NAT64/DNS64 egress. What makes it worth writing up is the structural mistake underneath it — and how the maintainers fixed it properly: hand-rolled IP guards keep matching IPv6 addresses by string spelling instead of parsing them into numeric values, leaving transition prefixes open across both TypeScript and Python.

TL;DR

  1. How it was found: Sibling-fix variant hunting triggered by an automated radar lead that was already patched — walking one hop from mcp-server-fetch (GHSA-66qx-2266-pmj6) through server-everything (GHSA-38j4-j742-j7r3) into modelcontextprotocol/inspector.
  2. The bug: isBlockedAddress() in core/mcp/node/fetchGuard.ts (@modelcontextprotocol/inspector >= 2.0.0, <= 2.16.0 and <= 1.0.6, plus @modelcontextprotocol/inspector-server <= 1.0.6) checked IPv6 addresses by string prefix (::ffff:, fe[89ab], literal fd00:ec2::254) and missed RFC 6052 NAT64 (64:ff9b::/96), allowing 64:ff9b::a9fe:a9fe (the NAT64 form of 169.254.169.254).
  3. The fix: Upgrade to @modelcontextprotocol/inspector 2.17.0 or 1.0.7 (inspector-server 1.0.7). In PR #3050 (and v1 counterpart #3049), the maintainers replaced string matching with 8×16-bit IPv6 group parsing and full RFC 6052 layout decoding across 64:ff9b::/96 and 64:ff9b:1::/48.
  4. Honest severity: Low (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N, score 3.7). No impact without NAT64/DNS64 egress.
  5. Detection for your own code: Semgrep rule SS-7 (mcp-ss-7-ip-guard-mapped-without-nat64-ts and -py) in aminrj-labs/ai-security-cve-lab flags TypeScript, JavaScript, and Python IP guards that unwrap ::ffff: without checking NAT64.

Credit and prior art

Credit belongs in both directions: this finding is a variant of the NAT64 SSRF class already reported and fixed in mcp-server-fetch (GHSA-66qx-2266-pmj6) and server-everything (GHSA-38j4-j742-j7r3, which explicitly cited the fetch fix as precedent). Walking sibling guards across adjacent repositories right after a patch lands is often where the remaining exposure sits.

The bug, traced through the call chain

When MCP Inspector connects to an MCP server using OAuth, the server can return an RFC 9728 Protected Resource Metadata document naming authorization_servers[0], or the user can supply an MCP server URL directly. Inspector’s Node backend routes those outbound requests through guardedFetch, which checks destinations in core/mcp/node/fetchGuard.ts.

At commit eb54b447 (2.16.0), an IPv6 literal followed this path:

  1. assertAllowedTarget(url, resolveHost, viaProxy, signal) (fetchGuard.ts:447) extracts the host via bareHost(url) (fetchGuard.ts:179-181), stripping the [...] brackets URL syntax places around an IPv6 literal.
  2. Node’s isIP(host) (node:net) recognizes 64:ff9b::a9fe:a9fe as a valid IPv6 literal (returning 6).
  3. Because the host is an IP literal, assertAllowedTarget calls assertNoneBlocked([host]) unconditionally — with no proxy dependency and no DNS resolution step. That is the same IP-literal path GHSA-fvg8-f358-w2c8 identified as the boundary for its metadata-address fix.
  4. assertNoneBlocked calls isBlockedAddress(ip) (fetchGuard.ts:142). For IPv6 inputs, isBlockedAddress lower-cased the string and checked only three spellings:
    • ::ffff: (IPv4-mapped IPv6), unwrapping the embedded IPv4 address
    • fe[89ab] (fe80::/10 link-local)
    • the literal string fd00:ec2::254 (AWS IPv6 IMDS)

Under RFC 6052, the well-known NAT64 prefix 64:ff9b::/96 embeds an IPv4 address in its low 32 bits (a9fe:a9fe is 169.254.169.254; 6464:64c8 is 100.100.100.200). Because 64:ff9b::a9fe:a9fe matched none of those three branches, isBlockedAddress returned false, and the fetch proceeded.

On a dual-stack or IPv4-only network with no NAT64 gateway, a packet to 64:ff9b::a9fe:a9fe goes nowhere. On an IPv6-only network with NAT64/DNS64 egress (common on IPv6-only cloud/corporate subnets, mobile carriers, and 464XLAT setups), the NAT64 translator strips the 64:ff9b::/96 prefix and forwards the request to 169.254.169.254.

Verification (synthetic, isolated)

My disclosure policy is to reproduce a finding twice from a clean state on synthetic data before reporting it, without writing or committing a live exploit.

Because isBlockedAddress() in fetchGuard.ts depends only on isIP from node:net and METADATA_IPV4_ADDRESSES, I extracted the function verbatim from commit eb54b447 and ran it under node --experimental-strip-types inside two independently started isolated containers (--network none, non-root, read-only root filesystem, all Linux capabilities dropped) against four synthetic inputs:

InputRepresentsExpectedObserved on 2.16.0
64:ff9b::a9fe:a9feNAT64 form of 169.254.169.254 (AWS/GCP/Azure IMDS)true (blocked)false (allowed)
64:ff9b::6464:64c8NAT64 form of 100.100.100.200 (Alibaba Cloud IMDS)true (blocked)false (allowed)
64:ff9b::0101:0101NAT64 form of 1.1.1.1 (public control)false (allowed)false (allowed)
169.254.169.254Plain IPv4 IMDS (sanity check)true (blocked)true (blocked)

Both isolated runs returned identical results. Paired with tracing assertAllowedTarget → bareHost → isIP → assertNoneBlocked in fetchGuard.ts, that confirmed reachability without touching any live network.

What the upstream fix changed

The maintainers fixed the root cause rather than adding one more prefix regex. In PR #3050 (commits f9307f3e and 3469894a, shipped in 2.17.0, with v1 counterpart #3049 shipped in 1.0.7), the IPv6 check in fetchGuard.ts stopped matching addresses by string spelling and instead parses every IPv6 address into its eight 16-bit groups and matches on numeric value:

  • ::ffff:0:0/96 and 64:ff9b::/96 extract the low 32 bits and re-check them through the IPv4 blocker.
  • 64:ff9b:1::/48 (RFC 8215 local-use NAT64) decodes every RFC 6052 prefix-length layout rather than assuming /96 only.
  • Unit tests in fetchGuard.test.ts pin the blocked forms, public-address controls, and both edges of fe80::/10.

That distinction — parse into numeric groups and match on value, never match IPv6 by string spelling — is the real takeaway from this bug. String checks break on zero-compression variants, leading zeros, and transition prefixes; numeric group parsing handles them uniformly.

Why the severity is Low (and why Python has the same trap)

The published advisory rates this Low, CVSS 3.1 3.7 (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N), calibrated directly against GHSA-38j4-j742-j7r3:

  • AC:H because exploitation requires a host whose network translates 64:ff9b::/96 via NAT64/DNS64. Without NAT64 egress, there is no impact.
  • UI:N because once a user connects Inspector to a malicious MCP server, OAuth discovery runs automatically without an extra click.
  • C:L because the path is information disclosure only, with no write primitive.

Calling a precondition-bound NAT64 bypass “critical” wastes everyone’s time. At the same time, the underlying blind spot is not unique to Node or to MCP Inspector. Python’s standard ipaddress module has the same trap:

1
2
3
4
>>> import ipaddress
>>> a = ipaddress.IPv6Address("64:ff9b::a9fe:a9fe")
>>> a.ipv4_mapped, a.is_private, a.is_global
(None, False, True)

If a Python MCP server or agent tool relies on ipv4_mapped plus is_private — or even not is_global — without explicitly handling 64:ff9b::/96 and 64:ff9b:1::/48, 64:ff9b::a9fe:a9fe passes all three checks.

Catching this automatically: Semgrep rule SS-7

To make this check repeatable across other MCP servers and agent backends, I added rule SS-7 to aminrj-labs/ai-security-cve-lab for TypeScript/JavaScript and Python. It flags any IP classifier that explicitly unwraps ::ffff: (or ipv4_mapped) while never mentioning 64:ff9b or nat64:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  - id: mcp-ss-7-ip-guard-mapped-without-nat64-ts
    message: >-
      This address classifier unwraps IPv4-mapped IPv6 (::ffff:) but never
      mentions the NAT64 prefixes 64:ff9b::/96 or 64:ff9b:1::/48. On a host with
      NAT64/DNS64 egress, 64:ff9b::a9fe:a9fe reaches 169.254.169.254. Also check
      6to4 (2002::/16) and other IPv4-embedding forms. SS-7.
    languages: [typescript, javascript]
    severity: ERROR
    metadata:
      sink-id: SS-7
      cwe: "CWE-918"
      reference: "https://github.com/modelcontextprotocol/inspector/security/advisories/GHSA-v2gx-m79c-pvxj"
    patterns:
      - pattern-either:
          - pattern: function $F(...) { $...BODY }
          - pattern: const $F = (...) => { $...BODY };
          - pattern: const $F = function (...) { $...BODY };
      - metavariable-regex:
          metavariable: $...BODY
          regex: (?s).*::ffff
      - metavariable-regex:
          metavariable: $...BODY
          regex: (?is)^(?!.*(64:ff9b|nat64)).*$

The Python counterpart (mcp-ss-7-ip-guard-mapped-without-nat64-py) runs the same check against def $F(...) bodies matching (ipv4_mapped|::ffff) without (64:ff9b|nat64).

What to check in your own egress guards

If your agent harness, MCP server, or OAuth client fetches peer-supplied URLs (RFC 9728 protected-resource metadata, OIDC discovery, Client ID Metadata Documents, or tool arguments):

  1. Parse IPv6 into numeric 16-bit groups, not strings. Unwrap and re-check all IPv4-embedding prefixes: ::ffff:0:0/96, RFC 6052 well-known NAT64 (64:ff9b::/96), RFC 8215 local-use NAT64 (64:ff9b:1::/48), 6to4 (2002::/16), and Teredo (2001::/32).
  2. Pin negative IPv6 vectors in unit tests. Include 64:ff9b::a9fe:a9fe, 64:ff9b:1::a9fe:a9fe, ::ffff:169.254.169.254, ::ffff:a9fe:a9fe, and fd00:ec2::254 alongside plain 169.254.169.254.
  3. Do not assume is_global excludes NAT64. As shown above in Python’s ipaddress, 64:ff9b::/96 reports is_global == True.
  4. Keep egress policy below the application too. Developer tools like Inspector run on laptops where application-level fetch guards are the primary boundary; in cloud and Kubernetes deployments, pair them with network egress policy and IMDSv2 hop limits.

Disclosure timeline and credits

  • 2026-11-18: Lookout radar surfaces a NAT64 CWE-918 lead (score 91) on mcp-server-fetch.
  • 2026-11-19: Confirmed mcp-server-fetch already fixed (GHSA-66qx-2266-pmj6); traced sibling fix in server-everything (GHSA-38j4-j742-j7r3); verified the NAT64 gap in modelcontextprotocol/inspector core/mcp/node/fetchGuard.ts (eb54b447, 2.16.0) across two isolated sandbox runs; submitted private GitHub Security Advisory.
  • 2026-11-27: Maintainers merged PR #3050 / #3049, released @modelcontextprotocol/inspector 2.17.0 and 1.0.7 (@modelcontextprotocol/inspector-server 1.0.7), and published GHSA-v2gx-m79c-pvxj (reporter credit: aminrj). CVE assignment requested from the maintainer; pending at publication time.

Method disclosure: Initial lead triage and sibling-guard search used AI-assisted tooling (my Lookout radar pipeline and local LLM triage); source-code tracing, isolated sandbox verification, and advisory review were performed directly against the upstream repository.

Primary sources

The Security Lab Newsletter

This post is the article. The newsletter is the lab.

Subscribers get what doesn't fit in a post: the full attack code with annotated results, the measurement methodology behind the numbers, and the week's thread — where I work through a technique or incident across several days of testing rather than a single draft. The RAG poisoning work, the MCP CVE analysis, the red-teaming patterns — all of it started as a newsletter thread before it became a post. One email per week. No sponsored content. Unsubscribe any time.

Join the lab — it's free

Already subscribed? Browse the back-issues →

This post is licensed under CC BY 4.0 by the author.