High

Flyto2 Core: SSRF guard validates the resolved IP but connects by hostname, allowing DNS-rebinding TOCTOU

  • Disclosed: 20.11.2026
  • Updated: 23.11.2026 00:04

Summary

validate_url_ssrf resolves the hostname, checks the IP against private ranges, then discards the IP and returns the hostname URL string. aiohttp performs a fresh, independent DNS resolution at connect time. An attacker controlling DNS for a hostname (TTL 0, alternating public IP and internal IP) passes validation on the first lookup and connects to the internal IP on the second — a classic check-then-use race. SECURITY_SSRF.md line 63 explicitly claims DNS-rebinding is prevented; it is not.

Root Cause

src/core/utils.py:523 returns the hostname URL after validation; the resolved IP is never pinned. A repo grep of http/ and utils.py for TCPConnector / resolver / response.history / on_request_redirect / IP-pinning returns NONE. Each module builds a fresh ClientSession per call → the connect-time getaddrinfo is independent of the validation-time lookup.

Impact

Defeats the SSRF guard on ALL modules that call it (readable internal fetch). Independent of IP-range completeness — the private IP is never presented to is_private_ip. Requires attacker DNS control + winning the resolution race → AC:H.

Proof of Concept

Code-proven: validate_url_ssrf returns the hostname (utils.py:523); no pinned-IP connector anywhere. Two independent resolutions occur (validation-time and aiohttp connect-time).

attacker DNS: rebind.attacker.tld TTL 0, alternating public IP and the cloud metadata IP
execute_module http.get {"url":"http://rebind.attacker.tld/latest/meta-data/..."}

Attack Chain

  1. Entry: http.get {url:"http://rebind.attacker.tld/..."}. Guard: validate_url_with_env_config. Bypass proof: getaddrinfo(rebind.attacker.tld) returns the public IP, is_private_ip=False (utils.py:511-519); returns the hostname URL (:523) — the IP is discarded.
  2. Sink: session.get("http://rebind.attacker.tld/...") (get.py:116). aiohttp performs a FRESH independent getaddrinfo at connect → now resolves to the internal IP. Bypass proof: no TCPConnector/AsyncResolver/pinned-IP in http/ (grep confirms none). Two lookups.
  3. Impact: internal fetch, body returned.

Bypass Evidence

utils.py:523 returns the hostname string, not a pinned IP; grep confirms no IP pinning or custom resolver anywhere on the path; fresh ClientSession per call guarantees an independent second resolution.

Affected Versions

<= 2.26.6 — utils.py:523 present on latest release tag; no pinning added on HEAD.

Suggested Fix

Resolve the hostname once, pin the validated IP, and connect to that IP (custom TCPConnector/resolver) — reject any connect-time resolution that differs. This is the fix SECURITY_SSRF.md already claims is in place.

Credit

Vulnerability discovered by zx (Jace).

What to do

The suggested fix is to resolve the hostname once, pin the validated IP, and connect to that IP (via a custom TCPConnector/resolver), rejecting any connect-time resolution that differs.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Python (PyPI) flyto-core < 2.26.8 2.26.8

References

CVSS score 7.1/10
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:N
Weakness (CWE)
CWE-367, CWE-918
Platform
Python (PyPI)
Package
flyto-core
Disclosed
20.11.2026
Updated
23.11.2026 00:04

Sources and licenses · Edited or translated by DockRay; source rights and applicable licenses are retained.

OSV / GitHub Advisory Database - GHSA-pfg2-w999-497v - CC BY 4.0

Vulnerability history: flyto-core

All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (10) in the archive
Total entries
10
First → latest
07.2026 11.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • Critical 2
  • High 8

Disclosures per year

  1. 2026: 10
Severity:
  1. Flyto2 Core: SSRF guard validates the resolved IP but connects by hostname, allowing DNS-rebinding TOCTOU this entry
    High · 7.1 CVE-2026-77313 < 2.26.8 2.26.8
  2. High · 8.6 CVE-2026-67425 < 2.26.7 2.26.7
  3. High · 8.4 CVE-2026-55786 >= 2.26.2, < 2.26.4 2.26.4

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.