Skip to content
Race condition Write-up Intermediate

I Exploited a Race Condition to Add Unlimited Restricted Items | Cyber Tamarin

The application checked whether a product was already in the cart and then inserted it as two separate steps, so simultaneous requests all passed the check. An attacker could add the same restricted item many times, bypassing the one-per-user limit.

cybertamarin Follow

Published on cybertamarin.medium.com

During one of my private VAPT engagements, I found a way to completely bypass this restriction using a race condition vulnerability.

Cyber Tamarin, on cybertamarin.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

Impact

Depending on the business logic, this could allow purchase-limit bypass, promotional abuse, inventory manipulation, multiple redemption of exclusive products, financial loss, or stock exhaustion; the text does not mention any defence that limited the exploit.

What the attacker needed

A user account; ability to send parallel requests

The fix

The check and insert should be combined into a single atomic transaction, backed by a database unique constraint on user and product and proper locking.

How it was found

  1. Capture the add-to-cart request in an intercepting proxy.
  2. Send the request to Repeater and duplicate it several times.
  3. Group the duplicated requests together.
  4. Send the whole group in parallel.

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, several 'add to cart' requests arrived at the same moment, all saw an empty cart, and all added the item. The fix is to make the check and the add 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 cybertamarin

View all

1 more disclosed report, 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.