Skip to content
Race condition Write-up Intermediate

“Day 22: The Race Condition Heist — How I Bought a $3,000 Drone for $0.01”

The checkout initiation endpoint checked stock and reserved items non-atomically, so simultaneous requests could each reserve the same single item. Combined with a first-order discount and a pricing glitch, the author obtained multiple free orders for an expensive drone.

Aman Sharma Follow

Published on infosecwriteups.com

The target was a high-traffic electronics retailer. Their checkout process was sleek and fast.

Aman Sharma, on infosecwriteups.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 inventory check and reservation were separate, non-atomic steps, so concurrent requests could both pass the check before either reservation was committed.

Impact

The author claims to have placed multiple orders for an out-of-stock item at no cost, though the account is self-published and the discount and pricing glitch were separate flaws that made the free orders possible.

What the attacker needed

A shopper account; a low-stock item; ability to send concurrent requests

The fix

The check and the stock decrement should be done in one atomic database operation, or the row locked for the duration of the transaction.

How it was found

  1. Map the checkout API calls with an intercepting proxy.
  2. Send two simultaneous requests to the checkout initiate endpoint for the same low-stock item.
  3. Observe two successful checkout identifiers returned for one item.
  4. Fire many simultaneous initiate requests and complete payment for each successful identifier.
  5. Receive multiple order confirmations at zero total.

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 is when a program does two things in sequence — first checking something, then acting on it — and someone slips a second request in between. Here the shop checked stock, then reserved the item, and two requests arriving together both passed the check before either reservation was saved. The result was more orders than there was stock.

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.

More by Aman Sharma

View all

34 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Race conditions

The lesson behind this report.

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.