Security: DNS rebinding bypasses SSRF protection in url_guard.rs
Summary
The URL guard in src/openhuman/tools/impl/network/url_guard.rs validates hostnames against the SSRF blocklist at request-build time, but does NOT resolve DNS before making the request. A DNS rebinding attack can pass validation with a public-looking hostname that resolves to 127.0.0.1 at connection time.
Location
src/openhuman/tools/impl/network/url_guard.rs — validate_url()
Impact
Medium — SSRF to internal services. An attacker registers a domain that alternates DNS responses between a public IP and a private IP (127.0.0.1, 169.254.x.x, 10.x.x.x).
Fix Available
PR #1918 adds validate_url_with_dns_check() which resolves the hostname and re-validates resolved IPs before the request. Callers (http_request.rs, curl.rs) should be migrated to use this function.
I can take this. I will keep the scope focused on migrating the outbound network tools to the existing DNS-aware URL guard, add deterministic tests around private resolved IPs / DNS failures, and avoid changing the allowlist policy beyond closing the rebinding gap.
Great, thanks for picking this up @Zavianx! The validate_url_with_dns_check() function landed in #1918 — the main work remaining is migrating callers in http_request.rs, curl.rs, and web_fetch.rs to use it instead of plain validate_url(). Happy to help review the PR.
Thanks, this is covered in PR #2009 now: http_request.rs, curl.rs, and web_fetch.rs have all been migrated to validate_url_with_dns_check(), with deterministic tests around resolver-driven private-IP rejection. CI is green on the PR, so it should be ready for review.