Skip to content
IDOR Write-up Beginner

One Cookie to Steal Them All: A Story of IDOR

The application trusted username values stored in cookies to identify the acting user, so an attacker could change those cookie values to another user's username and perform actions as that user. This allowed posting, commenting, deleting, and changing settings under the victim's identity, effectively an account takeover.

scriptjacker Follow

Published on scriptjacker.medium.com

Hey Hackers, I am Parth Narula. A penetration tester, bug hunter, red teamer and overall a security researcher.

Parth Narula, on scriptjacker.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 server used client-supplied cookie values as the sole identifier for the authenticated user without verifying them against a server-side session.

Impact

An attacker could perform any action as another user, including posting, commenting, deleting the account, changing settings, and sending messages, leading to full account takeover.

What the attacker needed

A free account; ability to intercept and modify requests

The fix

The application should not trust client-supplied identifiers for authorization; it should use a server-side session to determine the authenticated user.

How it was found

  1. Log in as the attacker account and intercept a post request.
  2. Change the cookie values from the attacker's username to the victim's username.
  3. Forward the modified request.
  4. Observe that the post appears under the victim's identity.

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.

Cookies are small pieces of data a website stores in your browser to remember who you are. Here, the site put your username in a cookie and trusted it without checking if you were really that person. By editing the cookie to say someone else's username, the attacker could act as that person.

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.

More by scriptjacker

View all

12 more disclosed reports, best first.

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.