Skip to content
IDOR Write-up Intermediate

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.

Nitin yadav, on medium.com

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

  1. Collect all JavaScript files loaded by the application, plus older versions from the Wayback Machine.
  2. Read the minified JavaScript bundle and find references to API endpoints not linked in the website.
  3. Identify the internal endpoint that returns user details for a given user ID.
  4. Request that endpoint with a user ID to retrieve sensitive profile and recovery-related data.
  5. Combine the leaked recovery data with the password reset flow to take over accounts.
  6. 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.

Similar reports

View all

Same bug class and techniques, clearest first.

Insecure direct object reference (IDOR)

The lesson behind this report.

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.