Skip to content
IDOR Write-up Beginner

Authorization Failures in Authenticated APIs A Practical Analysis

An authenticated API accepted a client-supplied user identifier in request bodies for account updates and other sensitive operations, using it to select the target account instead of the session identity. An attacker could modify any other user's account data, including password-related functionality, by changing that identifier while keeping their own valid session.

medium.com

Published on medium.com

Authorization bugs rarely announce themselves. They do not crash applications or trigger obvious errors.

Jawad Momani, 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

Root cause

Likely the backend used a client-supplied user identifier from the request body to select the target account for state-changing operations, instead of deriving the target from the authenticated session.

Impact

Any authenticated user could modify sensitive data belonging to any other account, including password-related functionality, with deterministic and repeatable horizontal privilege escalation.

What the attacker needed

A valid authenticated session; ability to intercept and modify requests

The fix

Authorization decisions should be bound exclusively to server-side session context, ignoring client-supplied identity selectors for sensitive operations and verifying ownership based on the authenticated identity.

How it was found

  1. Log in and capture an authenticated account update request that includes a user identifier in the body.
  2. Replay the request with the same session but change only the user identifier to reference a different account.
  3. Observe that the server processes the request successfully without an authorization error.
  4. Log in as the other account and confirm the modification was applied.

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 server gives you a session cookie so it knows who you are. In this app, some requests also included a user ID number in the request body, and the server trusted that number to decide which account to change. So a logged-in user could simply change the number to someone else's ID and edit their account, because the server never checked that the session belonged to that account.

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.