DNS Rebinding & Wildcard-DNS SSRF Payloads
SSRF payloads that attack DNS resolution: wildcard-DNS hosts (nip.io, sslip.io) that resolve to an internal IP, and DNS-rebinding records that flip to 127.0.0.1 after the validation check (TOCTOU).
When a filter resolves the hostname and checks the resulting IP, string encodings won't help — you attack the resolution itself. Wildcard-DNS services resolve a hostname to any IP you embed, satisfying "must be a domain" filters.
DNS rebinding beats resolve-then-check (TOCTOU): the validator's lookup returns a public IP and passes, then a near-zero TTL makes the client's own lookup return 127.0.0.1. It only works when there are two separate lookups with the check in between.
Reliability varies with DNS caching (Java caches aggressively; Go/Python with a fresh socket are more exploitable). Keep an out-of-band listener running to see which IP the fetch actually used.
Wildcard DNS → internal IP
Resolves to the embedded address (shown for 169.254.169.254).
169.254.169.254.nip.ionip.io → resolves to the embedded IP
169-254-169-254.nip.ionip.io dashed form
169.254.169.254.sslip.iosslip.io → resolves to the embedded IP
169-254-169-254.sslip.iosslip.io dashed form
make-169-254-169-254-rr.1u.msGeneric A-record encoder (resolves to the IP)
your-rebinder.example (e.g. rbndr.us / lock.cmpxchg8b.com)DNS rebinding: TTL-0 record that flips to the internal IP after the SSRF check
Wildcard DNS → loopback
127.0.0.1.nip.ionip.io → resolves to the embedded IP
127-0-0-1.nip.ionip.io dashed form
127.0.0.1.sslip.iosslip.io → resolves to the embedded IP
127-0-0-1.sslip.iosslip.io dashed form
make-127-0-0-1-rr.1u.msGeneric A-record encoder (resolves to the IP)
your-rebinder.example (e.g. rbndr.us / lock.cmpxchg8b.com)DNS rebinding: TTL-0 record that flips to the internal IP after the SSRF check
Defense
- Resolve once, pin that exact IP, and connect to the pinned address rather than re-resolving the hostname.
- Reject any resolved IP in private/loopback/link-local/reserved ranges — on every A/AAAA record.
- Cache DNS for the duration of the request so there's no second lookup to poison.
- Egress-filter so a rebind to an internal IP still can't connect.