How i found a Misconfigured CORS Vulnerability — Unauthorized Cross-Origin Resource Sharing :
The web application reflected arbitrary Origin headers in its Access-Control-Allow-Origin response, indicating a misconfigured CORS policy. An attacker could make cross-origin requests from a malicious domain to access sensitive data, potentially leading to data theft or session hijacking.
Published on medium.com
In the process of security testing, I identified a misconfigured Cross-Origin Resource Sharing (CORS) vulnerability in the web application, which allows unauthorized domains to access sensitive resources. The misconfiguration allows potential attackers to conduct unauthorized cross-origin requests and access sensitive…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the server reflected the Origin header value into Access-Control-Allow-Origin without checking it against an allowlist.
Impact
An attacker could make requests from a malicious domain, bypassing the same-origin policy and potentially accessing sensitive information, though the report does not demonstrate actual data theft.
What the attacker needed
Victim visits attacker-controlled page; browser sends Origin header; server reflects arbitrary Origin
The fix
The site should enforce strict origin whitelisting and use Access-Control-Allow-Credentials only when necessary.
How it was found
- Crawl the target site with Burp Suite to map its pages.
- Search responses for Access-Control headers to find CORS use.
- Add custom Origin headers such as attacker.com, null, attacker.target.com and target.attacker.com to requests.
- Check whether the custom Origin is reflected in Access-Control-Allow-Origin.
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 write-up 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 site echoed back any site name it was given, so a malicious page could ask for private data and the browser would allow it. The report does not show a working theft, only that the door was left open.
What is CORS?
A permissive cross-origin policy lets another site read responses with the user's credentials.