Null Origin and Credentialed CORS
Whether a CORS Misconfiguration can read authenticated data depends on
Access-Control-Allow-Credentials, the wildcard rule, cookie SameSite scope and the auth scheme. TrustingOrigin: nullis the allowlist entry that any attacker can produce.
How it works
Credential rules
- ACAC’s only valid value is
true. It lets JS read a response to acredentials: "include"request (OWASP HTTP Headers). ACAO: *combined withACAC: trueis rejected by the browser, so a wildcard never yields a credentialed read. Exploitable credentialed CORS therefore needs a dynamically echoed origin (DirectDefense, OWASP CSRF CS, Header Manipulation).- Frameworks hide this. FastAPI’s
CORSMiddlewarewith “any origin” andallow_credentials=Truegave Langflow credentialed cross-origin access from any site (Obsidian). Anti-pattern seen in the wild:ACAO: *plusACAC: trueplus a 30-dayMax-Age(thedreaming).
Where null comes from
- A sandboxed iframe with a
data:document sendsOrigin: null(Outpost24):<iframe sandbox="allow-scripts allow-top-navigation allow-forms" src="data:text/html,<script>/* credentialed fetch + exfil */</script>"></iframe> - In Chrome 58+,
Referrer-Policy: no-referrermade form POSTs sendOrigin: nulleven same-origin. Servers that allowlistnull“for compatibility” end up trusting it everywhere (Mixmax). - Probe it with
curl -sI -H "Origin: null" … | grep -i access-control-allow-origin; a reflectednullis the finding (Header Manipulation). - OWASP: never allow the
nullorigin (OWASP HTTP Headers).
Does the credential actually travel?
| Condition | Effect | Source |
|---|---|---|
| Cookie SameSite=None; Secure | Sent on cross-site fetch, so credentialed CORS is exploitable | Obsidian |
| Cookie Lax/Strict + Domain= | Cross-site fetch is stripped; pivot to a trusted subdomain (XSS or takeover) | Outpost24 |
| Accidentally enabled CORS under Lax-by-default | Cookies usually dropped | Reconless |
| Deliberately enabled CORS | “Mostly fine” for attackers; the bug is usually an allowlist bypass | Reconless |
| Authorization: Bearer only | Not auto-attached; look for the cookie-authed endpoint that issues or refreshes the bearer | Outpost24 |
| Cross-subdomain module or CSS load | Needs ACAC plus a reflected ACAO to carry cookies | AFINE |
Techniques / payloads
- Refresh-endpoint pivot: the access cookie was
SameSite=Laxand the APIs required a bearer, butrefresh_token_lfwasSameSite=None(valid for 7 days). A cross-originPOST /api/v1/refreshreturned a fresh access/refresh pair, which then reached/api/v1/validate/code(CVE-2025-3248) for RCE (Obsidian). - Token chain: read the CSRF token from a CORS-open generator endpoint, then call the token-gated session endpoint (Outpost24).
- JSON CSRF through credentialed CORS: a reflected ACAO plus ACAC permits a preflighted
application/jsonXHR, defeating content-type checks (DirectDefense). See JSON CSRF. - WebSocket analogue: CSWSH can read responses like a CORS misconfig, because WebSockets ignore SOP and preflight (Include Security).
Notable cases
- Langflow CVE-2025-34291 (CVSS 9.4): exploited in the wild. Attacker IPs are hard to attribute because the requests come from victims’ browsers. Mitigate with
LANGFLOW_CORS_ALLOW_CREDENTIALS=Falseor a restrictedLANGFLOW_CORS_ORIGINS; fixed by default in 1.7 (CrowdSec). - Outpost24 case 1.5: bank-style reflection that also accepted
null(Outpost24). - vAPI API7: reflected origin with ACAC exposing
authkey(vAPI).
Defenses
- Never allow
null. Send ACAC only with an origin taken from an exact-match allowlist, and omit it when credentials aren’t needed (OWASP HTTP Headers). - Send refresh tokens as
Authorization: Bearer, not cookies. If a cookie is required, useSameSite=Lax/Strictfor same-site deployments, or add a CSRF token when it must beNone(Obsidian). - Remember the browser enforces this. The server must refuse unknown origins on state-changing calls itself, e.g. cors-gate after
cors()(Mixmax).
Related
- CORS Misconfiguration (main guide) · Origin Reflection and Validation Flaws · CORS on Internal and Local Services
- SameSite Cookies · JSON CSRF · Session Management · Account Takeover
Sources
- Exploiting trust: Weaponizing permissive CORS configurations · original
- Using CORS policies to implement CSRF protection - Mixmax · original
- CVE-2025-34291: Critical Account Takeover and RCE in Langflow · original
- CVE-2025-34291 Exploited in the Wild: LangFlow AI Under Fire · original
- HTTP Headers · original
- Cross-Site Request Forgery Prevention Cheat Sheet - OWASP · original
- Header Manipulation: Bypasses, Probing, and the Security Audit Nobody Does · original
- Cross-Site WebSocket Hijacking Exploitation in 2025 - Include Security Research Blog · original
- Exploiting All 10 OWASP API Security Risks in vAPI (+ Bonus Arena Challenges) · original
- Bypassing Referer-Based CSRF with strict-origin-when-cross-origin · original
- Samesite by Default and What It Means for Bug Bounty Hunters · original
- Avoiding CSRF Attacks with API Design · original
- CSRF in the Age of JSON · original