How a Race Condition in Single-Use Coupon Redemption Led to Unlimited Credits and an $11,000 Bounty
A single-use voucher could be redeemed multiple times because the backend checked and updated its usage count without locking the database row. An attacker could send many simultaneous requests to apply the same voucher, receiving repeated discounts and generating large amounts of credit.
When developing e-commerce platforms and transaction-based web applications, engineers usually ensure that single-use assets — like discount coupons, gift cards, or referral rewards — are invalidated immediately upon use. Standard backend implementations update a database record, setting a flag like isused = true or…
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
Impact
An attacker could apply a single-use voucher many times, obtaining repeated discounts and potentially generating thousands of dollars in credit or reducing high-value bookings to zero.
What the attacker needed
A valid single-use voucher code; ability to send concurrent HTTP/2 requests
The fix
The issue was fixed by adding database row locking with atomic transactions and a Redis-based distributed mutex lock at the API gateway to reject concurrent duplicate requests.
How it was found
- Send a request to apply a valid single-use voucher to a cart.
- Use a tool to queue many identical requests with the same voucher code.
- Release all requests simultaneously over a single HTTP/2 connection.
- Observe that multiple requests succeed and the discount is applied repeatedly.
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 program checks something and then changes it, but other requests can sneak in between those two steps. Here, many requests asked to use the same one-time coupon at the same moment, and the system approved several of them before marking the coupon as used. This let the attacker get the discount many times from a single coupon.
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.