CORS Misconfiguration
The site reflected an arbitrary Origin in Access-Control-Allow-Origin while allowing credentials, so a malicious site could exfiltrate a victim's sensitive data.
Originally disclosed on HackerOne
- Disclosed after 16 days
Vulnerable Url: www.█████████ Summary: Cross-origin resource sharing (CORS) is a browser mechanism that enables controlled access to resources located outside of a given domain. However, it also provides a potential for cross-domain-based attacks, if a website's CORS policy is poorly configured and implemented. CORS can be exploited to trust any arbitrary domain attacker-controlled domain name and send the data to it. Attackers can make an exploit and ask the domain to send data of the victim to the attacker domain. Severity: High
As you can see when we run the above request in Burp Suite.
Access-Control-Allow-Origin: evil.com Access-Control-Allow-Credentials: true
Complexity: Easy
From : Remote / External
References
https://owasp.org/www-community/attacks/CORS_OriginHeaderScrutiny https://www.geekboy.ninja/blog/exploiting-misconfigured-cors-cross-origin-resource-sharing/ https://en.wikipedia.org/wiki/Cross-origin_resource_sharing https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
Impact
An Adversary can carry out a CORS attack to exfiltrate the sensitive details of a victim.
System Host(s)
www.████
Affected Product(s) and Version(s)
CVE Numbers
Steps to Reproduce
- Enter the domain name https://www.██████████ and add /wp-json after the url.
- Intercept the request and add Origin header, type evil.com in it and send the request.
- Use the exploit code given in the text file and save it as filename.html.
Suggested Mitigation/Remediation Actions
All the REST Apis should be authenticated and the domain should not trust any other domains. Allow only selected, trusted domains in the Access-Control-Allow-Origin header.
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
Likely the server reflected the request's Origin header into Access-Control-Allow-Origin without checking it against an allowlist, and also set Access-Control-Allow-Credentials to true.
Impact
An attacker could exfiltrate a victim's sensitive data via a CORS attack.
What the attacker needed
Target exposes /wp-json
The fix
The server should allow only explicitly trusted origins in Access-Control-Allow-Origin and should require authentication for the REST API endpoints.
How it was found
- Open the WordPress REST API path on the target domain.
- Intercept the request and add an Origin header with an attacker domain.
- Send the request and note the CORS response headers shown.
- Use the provided exploit page to make a victim's browser send their data to the attacker.
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.
Browsers normally stop one website from reading data from another website. CORS is a set of rules that lets a site say which other sites may read its data. Here the site said yes to every site and also allowed logged-in cookies, so any malicious page could read the victim's private data.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.