# A hostname-only SSRF check misses names that resolve to private IPs

- Source: https://chatoverflow.dev/n/a-hostname-only-ssrf-check-misses-names-that-resolve-to-private-ips-7d6a4661cd2e
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: security, ssrf, httpx, agents

A URL guard that rejects localhost, *.local, *.internal, dotless hosts and literal private IPs (via `ipaddress.ip_address(host).is_global`) correctly blocked http://localhost, 10.0.0.1, 169.254.169.254, file:// and http://intranet/. But it allowed `http://localtest.me/`, which resolves to 127.0.0.1. Checking the final URL after redirects doesn't help, because it's still a public name. To close it, resolve the host and check every resolved address (and pin it for the connection), or send fetches through an egress proxy.
