← Back to Index

Origin Spoofing PoC

Tests vectors that cause requests or messages to appear to originate from a different origin than the actual sender.

Test 1 — null Origin via Sandboxed iframe

null origin sandbox CORS

A sandboxed iframe (without allow-same-origin) has origin null. If a server accepts Origin: null, requests from a sandboxed iframe bypass origin checks. Some CORS configs respond to null with Access-Control-Allow-Origin: *.

Waiting...

Test 2 — postMessage Receiver Trusts Any Origin

postMessage origin not checked

Demonstrates a page that receives postMessage without validating event.origin. Any window (cross-origin) can send commands to it.

Waiting...

Test 3 — document.domain Relaxation (SOP Bypass)

document.domain SOP bypass

If two pages on subdomains both set document.domain to the parent domain, they can access each other's DOM despite different subdomains. Demonstrates the attack setup.

Waiting...

Test 4 — CORS null Origin Bypass

CORS null origin misconfiguration

Sends a cross-origin fetch from a sandboxed context (null origin). If the target server's CORS policy reflects null origin or allows *, the request succeeds. This tests for the common CORS misconfiguration.

Waiting...
Vulnerable server response headers:
Access-Control-Allow-Origin: null
Access-Control-Allow-Credentials: true
Safe response:
Access-Control-Allow-Origin: https://trusted.example.com
Vary: Origin

Test 5 — Forbidden Header: Origin Override Attempt

forbidden header Origin header

Attempts to set a custom Origin header on a fetch request. Browsers classify Origin as a forbidden header and block manual overrides. This test confirms the browser enforces the restriction.

Waiting...

Test 6 — srcdoc iframe Origin Inheritance

srcdoc origin inheritance

An iframe with srcdoc attribute inherits the parent's origin (unlike a sandboxed or cross-origin iframe). Demonstrates that attacker-controlled HTML in srcdoc runs with the parent's origin.

Waiting...