Skip to content
CORS Write-up Beginner

☠️ CORS of Destruction: How Misconfigured Origins Let Me Read Everything

An API reflected any Origin header in its CORS response while also allowing credentials, so a page on an attacker-controlled domain could read authenticated user data. The author claims this let them pull user info, internal notes, notifications and files, including tokens and report links.

infosecwriteups.com

Published on infosecwriteups.com

Free Link🎈

Iski, on infosecwriteups.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the API reflected whatever Origin header it received into Access-Control-Allow-Origin while also setting Access-Control-Allow-Credentials to true, with no allowlist check.

Impact

An attacker could read authenticated users' personal data, internal notes, notifications and files, including tokens, from any website the victim visited.

What the attacker needed

Victim logged in; victim visits attacker page; attacker-controlled domain

The fix

The API should validate the Origin against a server-side allowlist and never combine credentialed CORS with reflected or wildcard origins.

How it was found

  1. Find API endpoints by crawling subdomains and JavaScript files.
  2. Send a cross-origin fetch from an attacker domain with credentials included.
  3. Observe the response reflecting the attacker origin and allowing credentials.
  4. Host a proof-of-concept page that fetches the endpoint and forwards the response to a webhook.
  5. Replay the request with a modified Origin header to confirm there is no validation.
  6. Chain other authenticated endpoints to collect more data.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

When a website's script asks another server for data, the browser checks a permission slip called CORS. This server gave that permission to any website that asked, and also allowed the browser to attach the victim's login cookie. So a malicious page could quietly read the victim's private data from the API.

What is CORS?

A permissive cross-origin policy lets another site read responses with the user's credentials.

Similar reports

View all

Same bug class and techniques, clearest first.

CORS misconfiguration

The lesson behind this report.

A permissive cross-origin policy lets another site read responses with the user's credentials.