Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

fetch: SSRF guard misses RFC 6052 Well-Known NAT64 prefix (64:ff9b::/96) and ::/96

Aperta Adatta ai principianti
#5,181 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
75/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend, security

Direzione di ricerca

Inizia da src/fetch/src/mcp_server_fetch/server.py e leggi _NON_PUBLIC_NETWORKS e _is_public_address(). Verifica come vengono testate le voci IPv4-mapped e Local-Use NAT64 esistenti, quindi aggiungi test per i due prefissi segnalati e i relativi indirizzi IPv4 privati incorporati. Il lavoro è completato quando questi indirizzi vengono rifiutati e le destinazioni pubbliche mantengono il comportamento previsto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug server-fetch v2
Which server?

fetch (mcp-server-fetch)

Server version

latest (post PR #5033 / v2/main)

How did you run the server?

uvx or pip (PyPI package)

Transport

stdio

Protocol era

Modern (2026-07-28)

MCP client and version

Claude Desktop / MCP Inspector

Operating system and runtime

Linux / macOS / Windows, Python 3.10+

Steps to reproduce

Following the merge of PR #5033 ("fix(fetch): refuse private, loopback and metadata addresses by default (#4838)"), _is_public_address() in src/fetch/src/mcp_server_fetch/server.py checks IP addresses against _NON_PUBLIC_NETWORKS.

  1. Start mcp-server-fetch.
  2. Request fetching a target whose resolved IPv6 address maps to an internal IPv4 address using RFC 6052 Well-Known Prefix NAT64 (64:ff9b::/96) or deprecated IPv4-compatible IPv6 (::/96, RFC 4291).
    Examples:
    • 64:ff9b::127.0.0.1 (hex 64:ff9b::7f00:1)
    • 64:ff9b::169.254.169.254 (hex 64:ff9b::a9fe:a9fe)
    • ::127.0.0.1
  3. _is_public_address(ipaddress.ip_address("64:ff9b::127.0.0.1")) is evaluated.
Expected behavior

Under defense-in-depth egress filtering, addresses that translate/embed loopback, RFC 1918, link-local, or cloud metadata IPv4 addresses should be rejected by default, in the same manner as IPv4-mapped IPv6 (::ffff:0:0/96) and Local-Use NAT64 (64:ff9b:1::/48).

Actual behavior

In src/fetch/src/mcp_server_fetch/server.py, _NON_PUBLIC_NETWORKS includes:

  • ipaddress.ip_network("64:ff9b:1::/48") (RFC 8215 Local-Use IPv4/IPv6 Translation)
  • ipaddress.ip_network("::ffff:0:0/96") (RFC 4291 IPv4-mapped IPv6)

However, it omits:

  1. 64:ff9b::/96 (RFC 6052 Well-Known Prefix for IPv4/IPv6 translation)
  2. ::/96 (RFC 4291 IPv4-compatible IPv6)

Because standard Python ipaddress.IPv6Address("64:ff9b::127.0.0.1").is_global evaluates to True, _is_public_address() returns True, allowing the request to bypass the private destination refusal guard in dual-stack / NAT64 environments.

Logs or error output
>>> import ipaddress
>>> from mcp_server_fetch.server import _is_public_address
>>> 
>>> # Currently blocked:
>>> _is_public_address(ipaddress.ip_address("127.0.0.1"))
False
>>> _is_public_address(ipaddress.ip_address("::ffff:127.0.0.1"))
False
>>> 
>>> # Currently bypasses filter:
>>> _is_public_address(ipaddress.ip_address("64:ff9b::127.0.0.1"))
True
>>> _is_public_address(ipaddress.ip_address("64:ff9b::169.254.169.254"))
True
>>> _is_public_address(ipaddress.ip_address("::127.0.0.1"))
True
Already prototyped a fix?

Add both prefixes to _NON_PUBLIC_NETWORKS in src/fetch/src/mcp_server_fetch/server.py:

_NON_PUBLIC_NETWORKS: tuple[ipaddress.IPv4Network | ipaddress.IPv6Network, ...] = (
    # ... existing networks ...
    ipaddress.ip_network("64:ff9b::/96"),  # Well-Known NAT64 Prefix (RFC 6052)
    ipaddress.ip_network("64:ff9b:1::/48"),  # Local-Use IPv4/IPv6 Translation (RFC 8215)
    ipaddress.ip_network("::ffff:0:0/96"),  # IPv4-mapped IPv6 (RFC 4291)
    ipaddress.ip_network("::/96"),  # IPv4-compatible IPv6 (RFC 4291)
)

(Or inspect the embedded 32-bit IPv4 address for any address falling into /96 translation scopes to re-verify against IPv4 private definitions).

Before you submit
  • I searched existing issues and this is not a duplicate.
  • This is not a security vulnerability report (those go through the private advisory form).
Lingua principale
TypeScript
Stelle
91.4k
Fork
11.8k
Merge medio
7h 36m
PR unite (30g)
126

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di modelcontextprotocol/servers

Tutte le issue di modelcontextprotocol/servers

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.