CORS misconfiguration which leads to the disclosure of certain data concerning the user.
The CORS policy on an API endpoint was too permissive, allowing any origin to make credentialed cross-origin requests. An attacker could host a malicious page that reads the victim's subscription data when the victim visits it while logged in.
- Paid in 8 days
- Disclosed after 40 days
INTRODUCTION
I used an account to search for this vulnerability:
id: 5407773 email: [email protected]
IP used:
2a01:e34:ec2a:9240:7d25:26c3:1449:bfe7
endpoint URL:
https://www.semrush.com/content-paywall/api/accesslevel
Summary:
CORS policy too permissive.
EXPLOITATION
Description of Security Issue:
When we navigate on semrush we are led to make a request like this: █████ This request returns a JSON response with 4 elements (about Subscription):
-
product_group : ex: FREE , GUEST , ....
-
used_trial : If the user has used his trial period. ex: false , true , null (if he's a guest)
-
is_custom : I didn't understand this element.
-
upgraded : I think that says if the user has upgraded their account.
The problem is in the fact that when you send an origin that is not controlled by semrush the server still allows you to send cross-origin query.
Steps needed to reproduce bug:
- Put this payload on your website:
var invocation = new XMLHttpRequest();
invocation.onreadystatechange = function() {
if (invocation.readyState == XMLHttpRequest.DONE) {
alert(invocation.response);
}
}
function cors(){
if(invocation) {
invocation.open('GET', "https://www.semrush.com/content-paywall/api/accesslevel", true);
invocation.withCredentials = true;
invocation.send();
}
}
cors();
-
Connect you on semrush and visit the evil website
-
Congratulations your website has stolen some of your data!
FIX THE BUG
Stop setting Access-Control-Allow-Origin: .... and Access-Control-Allow-Credentials: true when the origin is not known.
Thank you and I remain at your disposal if necessary Have a nice evening :)
Impact
This allows all sites to access certain data about visitors who have semrush.
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 allowed cross-origin requests from unknown origins while also allowing credentials.
Impact
Any website could read certain subscription-related data about a logged-in visitor, but only that limited set of fields.
What the attacker needed
Victim is logged in to the target site; victim visits an attacker-controlled page
How it was found
- Host a page that sends a credentialed cross-origin request to the API endpoint.
- Log in to the target site in the same browser.
- Visit the attacker's page, which reads and displays 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 stops one website from reading data from another site unless that other site explicitly allows it. Here the server allowed every website to read the response, even when the request included the user's login cookies. So a malicious site could quietly fetch the user's subscription details.
What is CORS?
A permissive cross-origin policy lets another site read responses with the user's credentials.