Skip to content
CORS Write-up Beginner

Corsplay Of The Century How I Hijacked Apis With One Misconfigured Header

An API reflected any origin in its CORS headers while also allowing credentials, so a page on an attacker-controlled domain could read authenticated responses. The author claims this exposed user profiles, invoices and an admin summary, and describes it as leading to account takeover and data breach.

iski Follow

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 set a wildcard Access-Control-Allow-Origin together with Access-Control-Allow-Credentials, with no validation of the requesting origin.

Impact

The author claims an attacker could read authenticated profile data, list users and invoices, and view an admin summary, which they describe as account takeover and data exposure; the text does not show a defence limiting it.

What the attacker needed

Victim logged in to the target; victim visits attacker page

The fix

The server should stop combining a wildcard origin with credentials and instead allow only a whitelist of trusted origins.

How it was found

  1. Find API calls in the target's JavaScript files that send credentials with the request.
  2. Host a test page on an attacker-controlled domain that fetches the API endpoint with credentials included.
  3. Open the page in a browser already logged in to the target and observe the response body.
  4. Repeat the request against other endpoints such as user data, invoices and admin summary.

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 browser loads a page from one site, it normally blocks that page from reading responses from another site. CORS is the set of headers a server uses to say which other sites are allowed to read its responses. Here the server said any site could read them and also allowed the visitor's login cookies to be sent, so a malicious page could read the victim's private data.

What is CORS?

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

More by iski

View all

186 more disclosed reports, best first.

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.