# 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. Trusting `Origin: null` is 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 a `credentials: "include"` request ([[raw/cheatsheetseries.owasp.org/http-headers-6630|OWASP HTTP Headers]]). - `ACAO: *` combined with `ACAC: true` is rejected by the browser, so a wildcard never yields a credentialed read. Exploitable credentialed CORS therefore needs a *dynamically echoed* origin ([[raw/directdefense.com/csrf-in-the-age-of-json-4250|DirectDefense]], [[raw/cheatsheetseries.owasp.org/cross-site-request-forgery-prevention-cheat-sheet-owasp-2877|OWASP CSRF CS]], [[raw/infosecwriteups.com/header-manipulation-bypasses-probing-and-the-security-audit-nobody-doe-9157|Header Manipulation]]). - Frameworks hide this. FastAPI's `CORSMiddleware` with "any origin" and `allow_credentials=True` gave Langflow credentialed cross-origin access from any site ([[raw/obsidiansecurity.com/cve-2025-34291-critical-account-takeover-and-rce-in-langflow-3513|Obsidian]]). Anti-pattern seen in the wild: `ACAO: *` plus `ACAC: true` plus a 30-day `Max-Age` ([[raw/thedreaming.org/avoiding-csrf-attacks-with-api-design-2241|thedreaming]]). **Where `null` comes from** - A sandboxed iframe with a `data:` document sends `Origin: null` ([[raw/outpost24.com/exploiting-trust-weaponizing-permissive-cors-configurations-6598|Outpost24]]): ```html <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-referrer` made form POSTs send `Origin: null` even same-origin. Servers that allowlist `null` "for compatibility" end up trusting it everywhere ([[raw/mixmax.com/using-cors-policies-to-implement-csrf-protection-mixmax-932|Mixmax]]). - Probe it with `curl -sI -H "Origin: null" … | grep -i access-control-allow-origin`; a reflected `null` is the finding ([[raw/infosecwriteups.com/header-manipulation-bypasses-probing-and-the-security-audit-nobody-doe-9157|Header Manipulation]]). - OWASP: never allow the `null` origin ([[raw/cheatsheetseries.owasp.org/http-headers-6630|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 | [[raw/obsidiansecurity.com/cve-2025-34291-critical-account-takeover-and-rce-in-langflow-3513\|Obsidian]] | | Cookie `Lax`/`Strict` + `Domain=` | Cross-site fetch is stripped; pivot to a trusted subdomain (XSS or takeover) | [[raw/outpost24.com/exploiting-trust-weaponizing-permissive-cors-configurations-6598\|Outpost24]] | | Accidentally enabled CORS under Lax-by-default | Cookies usually dropped | [[raw/blog.reconless.com/samesite-by-default-and-what-it-means-for-bug-bounty-hunters-323\|Reconless]] | | Deliberately enabled CORS | "Mostly fine" for attackers; the bug is usually an allowlist bypass | [[raw/blog.reconless.com/samesite-by-default-and-what-it-means-for-bug-bounty-hunters-323\|Reconless]] | | `Authorization: Bearer` only | Not auto-attached; look for the cookie-authed endpoint that issues or refreshes the bearer | [[raw/outpost24.com/exploiting-trust-weaponizing-permissive-cors-configurations-6598\|Outpost24]] | | Cross-subdomain module or CSS load | Needs ACAC plus a reflected ACAO to carry cookies | [[raw/afine.com/bypassing-referer-based-csrf-with-strict-origin-when-cross-origin-12035\|AFINE]] | ## Techniques / payloads - **Refresh-endpoint pivot**: the access cookie was `SameSite=Lax` and the APIs required a bearer, but `refresh_token_lf` was `SameSite=None` (valid for 7 days). A cross-origin `POST /api/v1/refresh` returned a fresh access/refresh pair, which then reached `/api/v1/validate/code` (CVE-2025-3248) for RCE ([[raw/obsidiansecurity.com/cve-2025-34291-critical-account-takeover-and-rce-in-langflow-3513|Obsidian]]). - **Token chain**: read the CSRF token from a CORS-open generator endpoint, then call the token-gated session endpoint ([[raw/outpost24.com/exploiting-trust-weaponizing-permissive-cors-configurations-6598|Outpost24]]). - **JSON CSRF through credentialed CORS**: a reflected ACAO plus ACAC permits a preflighted `application/json` XHR, defeating content-type checks ([[raw/directdefense.com/csrf-in-the-age-of-json-4250|DirectDefense]]). See [[JSON CSRF]]. - **WebSocket analogue**: CSWSH can read responses like a CORS misconfig, because WebSockets ignore SOP and preflight ([[raw/blog.includesecurity.com/cross-site-websocket-hijacking-exploitation-in-2025-include-security-r-5000|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=False` or a restricted `LANGFLOW_CORS_ORIGINS`; fixed by default in 1.7 ([[raw/crowdsec.net/cve-2025-34291-exploited-in-the-wild-langflow-ai-under-fire-3443|CrowdSec]]). - **Outpost24 case 1.5**: bank-style reflection that also accepted `null` ([[raw/outpost24.com/exploiting-trust-weaponizing-permissive-cors-configurations-6598|Outpost24]]). - **vAPI API7**: reflected origin with ACAC exposing `authkey` ([[raw/medium.com/exploiting-all-10-owasp-api-security-risks-in-vapi-bonus-arena-challen-14687|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 ([[raw/cheatsheetseries.owasp.org/http-headers-6630|OWASP HTTP Headers]]). - Send refresh tokens as `Authorization: Bearer`, not cookies. If a cookie is required, use `SameSite=Lax/Strict` for same-site deployments, or add a CSRF token when it must be `None` ([[raw/obsidiansecurity.com/cve-2025-34291-critical-account-takeover-and-rce-in-langflow-3513|Obsidian]]). - Remember the browser enforces this. The server must refuse unknown origins on state-changing calls itself, e.g. cors-gate after `cors()` ([[raw/mixmax.com/using-cors-policies-to-implement-csrf-protection-mixmax-932|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 - [[raw/outpost24.com/exploiting-trust-weaponizing-permissive-cors-configurations-6598|Exploiting trust: Weaponizing permissive CORS configurations]] - [[raw/mixmax.com/using-cors-policies-to-implement-csrf-protection-mixmax-932|Using CORS policies to implement CSRF protection - Mixmax]] - [[raw/obsidiansecurity.com/cve-2025-34291-critical-account-takeover-and-rce-in-langflow-3513|CVE-2025-34291: Critical Account Takeover and RCE in Langflow]] - [[raw/crowdsec.net/cve-2025-34291-exploited-in-the-wild-langflow-ai-under-fire-3443|CVE-2025-34291 Exploited in the Wild: LangFlow AI Under Fire]] - [[raw/cheatsheetseries.owasp.org/http-headers-6630|HTTP Headers]] - [[raw/cheatsheetseries.owasp.org/cross-site-request-forgery-prevention-cheat-sheet-owasp-2877|Cross-Site Request Forgery Prevention Cheat Sheet - OWASP]] - [[raw/infosecwriteups.com/header-manipulation-bypasses-probing-and-the-security-audit-nobody-doe-9157|Header Manipulation: Bypasses, Probing, and the Security Audit Nobody Does]] - [[raw/blog.includesecurity.com/cross-site-websocket-hijacking-exploitation-in-2025-include-security-r-5000|Cross-Site WebSocket Hijacking Exploitation in 2025 - Include Security Research Blog]] - [[raw/medium.com/exploiting-all-10-owasp-api-security-risks-in-vapi-bonus-arena-challen-14687|Exploiting All 10 OWASP API Security Risks in vAPI (+ Bonus Arena Challenges)]] - [[raw/afine.com/bypassing-referer-based-csrf-with-strict-origin-when-cross-origin-12035|Bypassing Referer-Based CSRF with strict-origin-when-cross-origin]] - [[raw/blog.reconless.com/samesite-by-default-and-what-it-means-for-bug-bounty-hunters-323|Samesite by Default and What It Means for Bug Bounty Hunters]] - [[raw/thedreaming.org/avoiding-csrf-attacks-with-api-design-2241|Avoiding CSRF Attacks with API Design]] - [[raw/directdefense.com/csrf-in-the-age-of-json-4250|CSRF in the Age of JSON]]