EN \| Account Takeover and Sensitive Data Leakage via CORS Misconfiguration
The API server reflected any Origin header in Access-Control-Allow-Origin and allowed credentials, so a malicious site could read authenticated responses. The attacker could also send a PUT request to change the victim's email and read sensitive account data, leading to account takeover.
Published on lutfumertceylan.com.tr
In June of this year, I found a CORS Misconfiguration vulnerability in a datacenter company. The system was very simple, a PUT command sent to the API Server both changed the account email and showed all the data of the account in JSON format as Response.
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 any Origin value in Access-Control-Allow-Origin while also setting Access-Control-Allow-Credentials to true, instead of checking against an allowlist.
Impact
An attacker could change the victim's email address and steal sensitive account data, leading to account takeover.
What the attacker needed
Victim visits attacker's page while logged in; attacker controls a domain
How it was found
- Send a request with an Origin header and observe that the same value is reflected in Access-Control-Allow-Origin with credentials allowed.
- Replace the Origin with an attacker-controlled domain and confirm it is still reflected with a 200 response.
- Use a script to send a PUT request that changes the account email.
- Use the script to read the sensitive account data from the response and send it to a request-bin service.
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 server trusted every site, so a page on an attacker's domain could make requests as the logged-in user and read the replies. The attacker used that to change the victim's email address and steal account data.
What is CORS?
A permissive cross-origin policy lets another site read responses with the user's credentials.