Skip to content
Race condition Write-up Intermediate

**Race Conditions in the Wild: How I Turned Parallel Requests into a Critical Bug**

A one-time promotional credit could be applied multiple times because the check for prior use and the update were not atomic. An attacker could send parallel requests to stack the discount, drive the payable amount below zero, and complete checkout at a profit.

Đeepanshu Follow

Published on su6osec.medium.com

While testing a fintech-style web app, everything looked solid at first glance. Authentication was tight, endpoints were well-structured, and common bugs like IDOR or XSS were already patched.

Đeepanshu, on su6osec.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 coupon redemption logic performed a non-atomic check-then-act sequence without locking or a unique constraint, so concurrent requests all passed validation before any marked the coupon as used.

Impact

An attacker could stack a one-time discount repeatedly, push the total below zero, and complete checkout successfully, turning a payment into a profit; the text does not mention any defence that limited this.

What the attacker needed

A user account on the app; a one-time promotional credit; ability to send parallel requests

The fix

The redemption should be made atomic, for example with database locking or a unique constraint so only one request can mark the coupon as used.

How it was found

  1. Identify the endpoint that applies a one-time promotional credit during checkout.
  2. Send the same credit application request many times in parallel using a tool with multiple threads.
  3. Observe that multiple responses report the credit as applied rather than only one succeeding.
  4. Chain the stacked discounts through checkout to reduce the payable amount below zero.

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 acts on it, but another request slips in between the check and the action. Here, many requests asked 'has this coupon been used?' at the same moment, all got 'no', and all applied the discount. The fix is to make the check and the update happen as one indivisible step.

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 Đeepanshu

View all

3 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.