How I Crashed Example Health’s CORS Party
Authenticated API endpoints returned a wildcard Access-Control-Allow-Origin header, so any website could read the JSON responses of a logged-in patient. An attacker could host a page that fetches appointment, report and document data from the victim's browser and send it to their own server.
medium.com
Published on medium.com
FREE LINK
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
The API sent a wildcard CORS header on authenticated endpoints instead of restricting the allowed origin to the portal's own domain.
Impact
Any website could read authenticated API responses, potentially exposing a patient's appointments, lab results and documents; the author rated it critical despite a medium CVSS score.
What the attacker needed
Victim logged in to the portal; victim visits attacker page
The fix
The wildcard should be removed so only the portal's own origin is allowed, and sensitive APIs should not return the header at all.
How it was found
- Log in to the patient portal with a phone number and one-time code.
- Open the browser developer tools and inspect the network requests.
- Send a request to an authenticated API endpoint with an arbitrary Origin header and the session token.
- Observe the wildcard CORS header and the JSON data in the response.
- Host a page that fetches the same endpoints from the browser and displays the returned data.
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.
Browsers normally stop one website from reading data returned by another website. A CORS header tells the browser which other sites are allowed to read the response, and a star means 'any site at all'. Because the API also accepted the user's session, a malicious page opened by a logged-in patient could read their health records.
What is CORS?
A permissive cross-origin policy lets another site read responses with the user's credentials.