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 (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 (DirectDefense, OWASP CSRF CS, Header Manipulation).
  • Frameworks hide this. FastAPI’s CORSMiddleware with “any origin” and allow_credentials=True gave Langflow credentialed cross-origin access from any site (Obsidian). Anti-pattern seen in the wild: ACAO: * plus ACAC: true plus a 30-day Max-Age (thedreaming).

Where null comes from

  • A sandboxed iframe with a data: document sends Origin: 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-referrer made form POSTs send Origin: null even same-origin. Servers that allowlist null “for compatibility” end up trusting it everywhere (Mixmax).
  • Probe it with curl -sI -H "Origin: null" … | grep -i access-control-allow-origin; a reflected null is the finding (Header Manipulation).
  • OWASP: never allow the null origin (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=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 (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/json XHR, 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=False or a restricted LANGFLOW_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, use SameSite=Lax/Strict for same-site deployments, or add a CSRF token when it must be None (Obsidian).
  • Remember the browser enforces this. The server must refuse unknown origins on state-changing calls itself, e.g. cors-gate after cors() (Mixmax).

Sources