An unexploited CORS misconfiguration reflecting further issues
The API reflected any supplied Origin header and also sent the Access-Control-Allow-Credentials header, so a malicious site could read authenticated API responses. The author demonstrated this by manually injecting cookies into a browser and loading a proof-of-concept page that fetched account data cross-origin.
Published on smaranchand.com.np
Until and unless an issue or loophole present in the application is not exploited and made impactful in a real-life scenario, the term “vulnerability” doesn’t suit as the perfect noun for it.
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 API reflected the request's Origin header into Access-Control-Allow-Origin while also setting Access-Control-Allow-Credentials to true, instead of checking the origin against an allowlist.
Impact
An attacker who can get a victim to visit a malicious page could read the victim's account information from the API, but only if the attacker already has the victim's cookies, which the author notes makes exploitation highly complex.
What the attacker needed
Victim's session cookies obtained by other means; victim visits attacker-controlled page; API reachable from a browser
How it was found
- Intercept the mobile app's network traffic.
- Send a request with an Origin header set to an attacker-controlled domain and observe it reflected in the response.
- Note that Access-Control-Allow-Credentials is also present.
- Copy the session cookies from the intercepted request and inject them into a desktop browser.
- Host a page that makes a credentialed cross-origin request to the account endpoint and open it in the browser.
- Observe the account's sensitive information displayed in the attacker 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 normally stops one website from reading data from another site. Here the API told the browser to allow any website to read its responses, and it also allowed cookies to be sent. That means a page on an attacker's site could ask the API for the victim's account details and read the answer.
What is CORS?
A permissive cross-origin policy lets another site read responses with the user's credentials.