How i was able to get 29 free products. | Bug Bounty
The monthly free sample add-to-basket request could be sent many times simultaneously, and each request succeeded, allowing the attacker to obtain 29 free products instead of one. The attacker exploited a race condition in the basket endpoint.
Race condition occurs when two or more threads can access shared data and they try to change it at the same time. If you have a hard time understanding theoretical stuff, let me give you an example.
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
What the attacker needed
A monthly subscription; ability to capture and replay requests
How it was found
- Capture the request to add the free sample to the basket.
- Send the request to Turbo Intruder.
- Run the request many times simultaneously.
- Observe that all responses are 200 and the free sample was added multiple times.
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.
A race condition happens when a website checks something (like 'has this user already claimed their free sample?') and then updates the record, but two requests arrive so close together that both pass the check before either update is saved. Here, sending many requests at the same moment let the attacker add the free sample to the basket many times, getting more than the allowed one.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.