Skip to content
IDOR Write-up Beginner

From a Simple Profile Endpoint to a 100k+ User IDOR on HackerRank

A profile endpoint exposed internal user IDs, and a preferences endpoint accepted a user-controlled identifier without checking ownership, letting an authenticated user modify another user's notification preferences. Because IDs were predictable and over 100k profiles were discoverable, the flaw could be automated at scale.

medium.com

Published on medium.com

This write-up was published with permission from HackerRank, with sensitive details properly redacted to keep users safe.

Hangga Aji Sayekti, 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 authenticated attacker could modify the notification preferences of any other user whose identifier they knew, and because over 100k profiles were discoverable, this could be automated at scale.

What the attacker needed

A free account; victim's user ID known or discoverable; attacker authenticated

The fix

The issue was fixed by enforcing server-side authorization checks so users can only modify their own resources, and by reducing exposure of internal identifiers.

How it was found

  1. Browse the site with browser developer tools open and notice the profile endpoint that returns an internal user ID.
  2. Open the email preference settings and observe the request that uses 'me' as the user identifier.
  3. Create two accounts you own, one as victim and one as attacker.
  4. Replace the 'me' identifier in the preference request with the victim's user ID and send it.
  5. Observe a 200 OK response and confirm the victim's preferences changed.

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.

When you log in, the site knows who you are, but it must also check that you are allowed to change a particular item. Here, the site let a logged-in user change settings belonging to someone else just by swapping an identifier in the request. This is called an IDOR, short for Insecure Direct Object Reference, where an object is referenced directly by an identifier the user can control.

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.