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.
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.
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
- Intercept cart requests in a proxy and note the cart identifier in a GET request to the API.
- Start a separate session and load the cart using the same identifier.
- Send a PATCH request to the same API endpoint with a JSON body containing an item ID to add an item.
- 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.