Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto Apto para principiantes
#5,181 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
75/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python
Área
backend, security

Línea de trabajo

Empieza en src/fetch/src/mcp_server_fetch/server.py y lee _NON_PUBLIC_NETWORKS y _is_public_address(). Comprueba cómo se prueban las entradas existentes IPv4-mapped y Local-Use NAT64; después, añade cobertura para los dos prefijos indicados y sus direcciones IPv4 privadas incrustadas. La tarea estará terminada cuando esas direcciones se rechacen y los destinos públicos mantengan el comportamiento esperado.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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).
Lenguaje dominante
TypeScript
Estrellas
91.4k
Forks
11.8k
Merge medio
7 h 36 min
PR fusionados (30 d)
126

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de modelcontextprotocol/servers

Todos los issues de modelcontextprotocol/servers

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.