Blind Webhook Proxy
// Scenario
A notification service lets users register webhook URLs and invokes dispatch_webhook(url, resolver, http_get) / dispatchWebhook(url, resolver, httpGet).
resolver(hostname)returns a list of resolved IP strings (e.g.,["93.184.216.34"]).http_get(resolved_ip, parsed_url)performs the simulated outbound request.
// The Vulnerability
Currently, the code only checks if "localhost" in url or "127.0.0.1" in url. Attackers bypass this easily using:
- Alternate loopback/private IPs (
169.254.169.254cloud metadata,10.0.0.1,172.16.0.1,192.168.1.1,0.0.0.0,::1,fc00::/7) - Decimal/hex/octal IP notation (
2130706433,0x7f000001) - DNS hostnames that resolve to internal IPs (or multiple IPs where one is private)
- Non-HTTP schemes (
file://,gopher://) or URL credentials (http://example.com@127.0.0.1).
// Your Task
Validate the URL scheme (http/https only, no embedded credentials), resolve the hostname via resolver(hostname), validate every resolved IP address is a globally routable public IP (reject loopback, private, link-local, multicast, unspecified, carrier-grade NAT 100.64.0.0/10, IPv4-mapped IPv6 ::ffff:127.0.0.1), and pass the validated public IP to http_get(ip, url) to avoid DNS rebinding. Return {"ok": False, "error": "blocked"} when blocked.
Sample Sanity Checks (1)
- Public webhook succeedsValid HTTPS URL resolving to 93.184.216.34 calls http_get
[idle] Press RUN to execute visible sample checks, or SUBMIT to run hidden exploit & functionality suites.