Task 1 of 3

How Attackers Steal API Data Without XSS

In 2022, a researcher discovered that a major fintech API platform had a CORS misconfiguration that allowed any website to make authenticated cross-origin requests and read the responses. The API handled financial transactions and account data for millions of users.

The researcher created a simple proof-of-concept webpage. When any logged-in user visited it, the page silently made a request to the fintech API using the victim's browser cookies — and displayed all their account data. No XSS. No malware. Just a misconfigured HTTP header.

What is CORS?

Browsers enforce the Same-Origin Policy (SOP) — by default, a script on evil.com cannot make a request to bank.com and read the response. This protects users from malicious websites reading their data from other sites.

CORS (Cross-Origin Resource Sharing) is a system that lets servers relax this restriction for legitimate use cases. A server adds special headers telling the browser which origins are allowed to read the response:

Access-Control-Allow-Origin: https://trusted-partner.com
Access-Control-Allow-Credentials: true

This is useful — it lets app.company.com make API calls to api.company.com. But when misconfigured, it lets any website do the same.

CORS MISCONFIGURATIONS — FROM BAD TO WORSE
Wildcard + no credentials
Access-Control-Allow-Origin: *
Any site can read public responses — credentials not sent. Low risk for public APIs.
Reflect Origin + credentials
Access-Control-Allow-Origin: [reflects req.origin]\nAccess-Control-Allow-Credentials: true
Any site can read authenticated responses. Critical — full account takeover possible.
Null origin allowed
Access-Control-Allow-Origin: null\nAccess-Control-Allow-Credentials: true
Sandboxed iframes get "null" origin. Attacker exploits via data: URI iframe.
Subdomain wildcard
Access-Control-Allow-Origin: *.company.com
XSS on any subdomain becomes full API access — trust chain weakness.
1

What two response headers together create a critical CORS misconfiguration?

Answer all 1 question to continue