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.
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.
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.
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/..."}
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.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.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.
<= 2.26.6 — utils.py:523 present on latest release tag; no pinning added on HEAD.
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.
Vulnerability discovered by zx (Jace).
{
"cwe_ids": [
"CWE-367",
"CWE-918"
],
"github_reviewed": true,
"github_reviewed_at": "2026-11-20T00:09:23Z",
"nvd_published_at": null,
"severity": "HIGH"
}