Skip to content
IDOR Write-up Beginner

I Slipped an Item Into a Stranger’s Cart(Well, Almost)

A cart API endpoint accepted a cart identifier without checking ownership, so any session could read and modify another user's cart. An attacker who knew a cart ID could add items to a stranger's cart without authentication.

nizarkadiri70 Follow

Published on medium.com

It started the same way most bug bounty journeys begin — with a bit of curiosity, a browser & a proxy, and way too much coffee.

Nizar Kadiri, 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 cart API looked up carts by the supplied identifier without verifying that the caller owned that cart or was authenticated.

Impact

An attacker who knew a cart ID could read and add items to another user's cart without authentication, which could cause disruption on a large e-commerce platform.

What the attacker needed

Knowledge of a victim's cart ID; no authentication needed

How it was found

  1. Intercept cart requests in a proxy and note the cart identifier in a GET request to the API.
  2. Start a separate session and load the cart using the same identifier.
  3. Send a PATCH request to the same API endpoint with a JSON body containing an item ID to add an item.
  4. Repeat with different sessions, incognito windows and fresh accounts to confirm the result.

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.

Every shopping cart has an identifier so the website knows whose cart it is. Here the server trusted whatever identifier was sent and never checked that the person sending it owned that cart. That means anyone who learns or guesses an identifier can read and change someone else's cart.

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 nizarkadiri70

View all

1 more disclosed report, 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.