From Reflected XSS to Critical Bug Led to Sensitive Data Leakage
A reflected XSS vulnerability in a search function allowed an attacker to execute JavaScript in the context of a trusted subdomain. By chaining this with a permissive CORS policy that trusted that subdomain, the attacker could read sensitive user data (emails, phone numbers, subscription plans) and exfiltrate it to an external server.
Today I will share with you the latest attack chain I found on a development-stage application that led me to access the users’ critical data, including emails, phone numbers, and subscription plan info.
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 application reflected user input without sanitisation in a search function, and its CORS policy trusted any subdomain of the app, including the vulnerable one, to access sensitive data endpoints.
Impact
An attacker could access and exfiltrate sensitive user data including emails, phone numbers, and subscription plan information.
What the attacker needed
A free customer account; victim visits a crafted link
The fix
The report recommends fixing the XSS through strict input validation and sanitisation, and hardening the CORS policy to only allow specific assets that require access to sensitive endpoints.
How it was found
- Perform basic reconnaissance on the target and create a customer account.
- Locate the search functionality used to search for financial deals.
- Inject a basic XSS payload into the search input and observe it executes.
- Replace the XSS payload with JavaScript that fetches data from the vulnerable CORS endpoint with credentials and sends it to an attacker-controlled server.
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.
Cross-site scripting (XSS) lets an attacker run their own JavaScript in a victim's browser on a trusted website. CORS is a browser rule that controls which websites can read data from another site; if misconfigured, it can allow a malicious site to steal data. Here, the attacker used the XSS to make the trusted site itself request sensitive data and send it to the attacker.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.