llamaCVEVulnerability Intelligence
/
Advisory · GitHub · PyPI · flyto-core

GHSA-V7Q9-PR72-5FMV

port.check skips the IPv6 transition SSRF guard because gethostbyname raises first and the gaierror handler is a bare pass

Parche disponible
Descargar PNG JSON
CVSS
—
medium
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versiónPrimer parche el mismo día de la divulgación
Exposición105 dDesde la divulgación, 6 ago 2026, 8:52 p. m.
Detección103 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Parche 2.26.12
Monitoreo
Detectada +1
7 ago 26
18 nov 26
20 nov 26
7 ago 26
2 sept 26
28 sept 26
24 oct 26
20 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-V7Q9-PR72-5FMV divulgada
Remediación Parche 2.26.12 flyto-core · 0 d desde divulgación
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés
Summary

`port.check` resolves the host with `socket.gethostbyname()` before deciding whether the target is private. That call raises `gaierror` on every IPv6 literal, the handler is a bare `pass`, and the module then connects anyway, so `::ffff:127.0.0.1` reaches loopback even though `is_private_ip()` was hardened for CVE-2026-55787 to catch exactly that form.

Details

Confirmed on the released tag `v2.26.10` (`4607421fd875171239ca0509c4b9e3838763f92c`) and on `main` at `d19ac05f599e1c44390d5f5134135fff45e3e9b3`. I re-checked `v2.26.11` while writing this and the same bare `pass` is still there.

`src/core/modules/atomic/port/check.py`, the guard:

try:
    resolved_ip = socket.gethostbyname(host)
    ...
except socket.gaierror:
    # DNS resolution failed - allow the check to fail naturally
    pass

and the connect that follows, in `_check_port_async()`:

future = asyncio.open_connection(host, port)
reader, writer = await asyncio.wait_for(future, timeout=timeout)

The hardening this guard is supposed to apply lives in `is_private_ip()`, which already unwraps IPv4-mapped, IPv4-compatible, 6to4 and NAT64 forms. That is the working half. `port.check` never gets there for an IPv6 literal, because the resolution step blows up first and the `except` clause does not block. The comment says "allow the check to fail naturally", but `asyncio.open_connection` accepts the literal directly and does not fail.

A caller holding the Flyto Core bearer token invokes `port.check` with `host` set to an IPv6 literal that carries a private or link-local IPv4 inside it. The private-IP check is skipped and the outbound TCP connect is attempted against the real target.

`::ffff:127.0.0.1` reaches loopback. `::ffff:169.254.169.254` reaches the cloud metadata address on the same principle. `2002:7f00:1::1` and `64:ff9b::a9fe:a9fe` are the 6to4 and NAT64 spellings of the same two targets and hit the same `gaierror` path, though whether they route depends on the host's networking.

The result is internal port reachability probing and topology inference. `port.check` reports whether the port is open, not the response body, so this is a reachability oracle rather than a data-exfiltration primitive. That bound is why I am not scoring confidentiality high.

The precondition is the bearer token. Flyto Core uses a single global token, so anyone who can call the API at all can do this. There is no privilege escalation involved, just a bypass of the SSRF guard the API tries to enforce.

PoC

Partial, and I want to be exact about which half is which.

Executed against the real module, through `ModuleRegistry.get('port.check')` with `params={'port': 80, 'host': '::127.0.0.1', 'connect_timeout': 0.1}`:

port.check output keys: ['closed_ports', 'ok', 'open_ports', 'results', 'summary']
blocked: False
summary: {'total': 1, 'open': 0, 'closed': 1}

The point is `blocked: False`. The module's SSRF return shape (`error_code: 'SSRF_BLOCKED'`) is not produced, so execution carried on to the connect attempt. That run used `::127.0.0.1`, a valid literal for showing the guard fails open but not a target that routes anywhere useful.

Executed separately, to show the same `gaierror` path opens on a literal that does route, and that the connect then succeeds. Python 3.9.6 on macOS 26.5 arm64:

gethostbyname('::127.0.0.1') -> gaierror [Errno 8] nodename nor servname provided, or not known
gethostbyname('::ffff:127.0.0.1') -> gaierror [Errno 8] nodename nor servname provided, or not known
gethostbyname('2002:7f00:1::1') -> gaierror [Errno 8] nodename nor servname provided, or not known
gethostbyname('64:ff9b::a9fe:a9fe') -> gaierror [Errno 8] nodename nor servname provided, or not known
listener on 127.0.0.1:59450
open_connection('::ffff:127.0.0.1', 59450) -> CONNECTED
open_connection('127.0.0.1', 59450) -> CONNECTED

Both halves of the claim are executed: the guard does not fire, and `::ffff:127.0.0.1` is a live route to loopback through `asyncio.open_connection`. What I did not do is chain them in one run against a listening internal service through the HTTP API, which is the only reason I am calling verification partial rather than complete.

Impact

Server-side request forgery (CWE-918) restricted to a TCP reachability oracle. A token holder can probe loopback, link-local (including the cloud metadata address) and RFC1918 ports that the SSRF guard is meant to deny, and learn which are open.

Suggested fix

Fail closed, and use the transition-aware check you already have. In `src/core/modules/atomic/port/check.py`:

try:
    resolved_ip = socket.gethostbyname(host)
    if is_private_ip(resolved_ip):
        return _blocked(host, port)
except socket.gaierror:
    return _blocked(host, port)

Better still, run `is_private_ip(host)` on the literal before attempting resolution at all. It already handles IPv4-mapped, IPv4-compatible, 6to4 and NAT64, so the transition forms get caught without needing DNS to succeed. The general rule worth adopting is that an unresolvable host should be treated as unsafe rather than as unchecked.

Why this is not CVE-2026-55787

GHSA-794r-5rp2-fpg8 (CVE-2026-55787) is the SSRF hardening that taught `is_private_ip()` to unwrap IPv6 transition forms. That fix is correct and it is present in the code I audited. The problem is that `port.check` never calls it on this path: `gethostbyname()` raises before the check would run, and the bare `pass` lets the request through. So the mitigation exists and one of its consumers routes around it. If you consider that in scope for the original advisory, this is a follow-up rather than a new issue, and I have no objection to it being handled that way.

Severity

Medium. `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N` (4.3).

`PR:L` for the bearer token. `AC:L` because it is one host string. `C:L` because what the attacker gets is open or closed per port, which is real reconnaissance but not the contents of anything. `I:N` and `A:N`: `port.check` is bounded and does not give a write or a flood primitive, so I have not claimed either.

An earlier draft of this report also claimed a browser-session auto-attachment authorization bug. I withdrew it: with a single global bearer token there is no authorization boundary between callers for it to cross, so it was not a vulnerability. I mention it so the record is straight rather than quietly dropping it.

I used AI assistance for the audit and drafting. I manually verified the `blocked: False` output by running the real module through `ModuleRegistry`, the stdlib behaviour showing `gethostbyname` raising on all four IPv6 literals while `asyncio.open_connection('::ffff:127.0.0.1', ...)` connects, and that the bare `except socket.gaierror: pass` is still present in the released `v2.26.11`.

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Versiones

Rangos afectados

Afectada Corregida Última
flyto-core≤ 2.26.11
2.26.11
2.41.0
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
pypiflyto-core
Corregida 2.26.12 0 d 2.41.0 no afectada
Versiones corregidas2.26.12
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/flytohub/flyto-core/security/advisories/GHSA-v7q9-pr72-5fmv

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.