How One JavaScript File Led Me to Account Takeover
An unlinked internal API endpoint, discovered by reading a minified JavaScript bundle, returned sensitive per-user profile data including information used in password reset and account recovery. An attacker could read this data for any user ID and combine it with the reset flow to take over accounts.
medium.com
Published on medium.com
This story is why I tell every beginner: READ THE JAVASCRIPT. One dusty JS file handed me a path to account takeover on a target I’d nearly given up on.
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
Impact
An attacker could read sensitive per-user recovery data for any user ID and combine it with the reset flow to take over accounts.
What the attacker needed
Access to the application's JavaScript files; knowledge of a target user ID; no authentication required (implied)
How it was found
- Collect all JavaScript files loaded by the application, plus older versions from the Wayback Machine.
- Read the minified JavaScript bundle and find references to API endpoints not linked in the website.
- Identify the internal endpoint that returns user details for a given user ID.
- Request that endpoint with a user ID to retrieve sensitive profile and recovery-related data.
- Combine the leaked recovery data with the password reset flow to take over accounts.
- Verify the takeover on two accounts you control and document the exact requests.
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.
Websites often ship JavaScript files that contain references to hidden API endpoints not linked in the visible interface. Here, one such endpoint returned sensitive user data, including details used in password reset, for any user ID. By combining that leaked data with the reset process, an attacker could take over other people's accounts.
What is IDOR?
One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.