JSONpocalypse Now: How JSONP Exposure Led to Sensitive Data Leaka
A JSONP endpoint on a data API returned sensitive user profile data without authentication, and an internal admin API endpoint exposed admin tokens. An attacker could exfiltrate this data by tricking a victim into loading a malicious page.
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
Likely the JSONP endpoints lacked authentication and authorization checks, and CORS was misconfigured to allow any origin with credentials.
Impact
The exposed data included full names, emails, billing info, and admin tokens, which could lead to full account takeover.
What the attacker needed
Victim visits a malicious page; no authentication needed for data API; admin API accessible with spoofed Origin
How it was found
- Find the data API endpoint with a callback parameter that wraps JSON in a function.
- Create an HTML page that defines a function to send the data to an attacker-controlled server.
- Include a script tag pointing to the JSONP endpoint with the callback set to that function.
- Host the page and visit it to see the data exfiltrated.
- For the admin endpoint, send a request with a spoofed Origin header to retrieve admin tokens.
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.
JSONP is an old technique where a website returns data wrapped in a function call, so another site can read it. Here, the endpoint did not check who was asking, so anyone could load it and read private user details. The admin endpoint also leaked a secret token that could give full control.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.