CORS Headers Reference
Exploitable Misconfigurations
Reflected Origin
When the server dynamically reflects theOrigin header value in Access-Control-Allow-Origin:
Null Origin Exploit
Some applications whitelistnull origin for local development. Use a sandboxed iframe to generate null origin:
Regex Bypass Techniques
XSS on Whitelisted Subdomain
Ifsub.requester.com is whitelisted and vulnerable to XSS:
Server-Side Cache Poisoning
If the server doesn’t sanitize theOrigin header for illegal characters, inject HTTP headers via \r\n (0x0d 0x0a):
Client-Side Cache Poisoning
If the page reflects a custom header without encoding:Vary: Origin), subsequent visits serve the poisoned response.
XSSI / JSONP Bypass
DNS Rebinding Attacks
DNS Rebinding via TTL
- Victim visits attacker’s page
- Attacker changes DNS A record (TTL=0) to internal IP
- Victim’s browser re-resolves DNS and now same-origin with internal service
- Attacker can read internal service responses
DNS Rebinding via Multiple IPs
- Set two A records: attacker IP +
0.0.0.0(Linux/macOS) - First request goes to attacker IP (serves payload)
- Attacker blocks their IP with iptables
- Second request resolves to
0.0.0.0(localhost) - Browser treats as same origin
DNS Rebinding over DoH (DNS-over-HTTPS)
Some DoH providers (NextDNS) replace private/loopback answers with
0.0.0.0, but Linux/macOS still route to local services.Protections Against DNS Rebinding
- Use TLS in internal services
- Require authentication to access data
- Validate the
Hostheader on internal services - Implement HTTPS with valid certificates
Tools
- CORScanner
- Corsy
- CorsOne
- theftfuzzer
- Burp Collaborator Everywhere (Burp extension)