CVE-2026-77316: Flyto2 Core: SSRF guard bypass via DNS rebinding (validate_url_ssrf resolves-then-connects without pinning)
High CVSS 7.1
- OSV id
- GHSA-6pm8-6f34-9v3g
- Also known as
- CVE-2026-77316
- Published
- Last modified
Affected packages
| Package | Affected versions | Fixed in |
|---|---|---|
| flyto-core PyPI |
< 2.26.8 | 2.26.8 |
How to fix it
Upgrade flyto-core to 2.26.8 or later.
# in requirements.txt: change the line to flyto-core==2.26.8
pip install -r requirements.txt
- If it is an indirect dependency, upgrade the package that depends on it, or add a minimum version constraint for it (e.g. in constraints.txt, or as a dependency in pyproject.toml).
- Check the changelog for breaking changes (especially across major versions), update the lockfile with the package manager, and run your tests.
Not sure whether your project uses an affected version? Check your lockfile below for free.
Details
[MEDIUM] SSRF guard bypass via DNS rebinding — validateurlssrf 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(PyPIflyto-core), HEADae2b38e(v2.26.7).src/core/utils.py::validate_url_ssrf(resolution atgetaddrinfo~L512,is_private_ipcheck ~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
- Attacker controls DNS for
rebind.attacker.test(TTL 0), and drives any guarded HTTP module withurl=http://rebind.attacker.test/(recipe / MCPexecute_module). - Guard:
getaddrinfo→ public IP →is_private_ipfalse → URL allowed. - Outbound request: aiohttp re-resolves
rebind.attacker.test→ attacker now answers127.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, thensession.request(url)resolves again with no pin. - Does aiohttp's DNS cache prevent it? No — the guard's
socket.getaddrinfoand 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
getaddrinforesults 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-
References
- GHSA-6pm8-6f34-9v3g on OSV.dev
- Web: https://github.com/flytohub/flyto-core/security/advisories/GHSA-6pm8-6f34-9v3g
- Web: https://github.com/flytohub/flyto-core/commit/bf748df864d348004cf45d830bc59f62c5c4a58a
- Package: https://github.com/flytohub/flyto-core
- Web: https://github.com/flytohub/flyto-core/releases/tag/v2.26.8
Am I affected?
Upload or paste your lockfile. We check every package version in it against OSV.dev, this advisory included, and email you the vulnerable ones with the version that fixes them. Free, and no account needed.
About this data
Source: GitHub Advisory Database via OSV.dev (CC-BY 4.0). Severity comes from the advisory's own rating when it has one, else from its CVSS score.