Skip to content
Race condition Write-up Intermediate

How I Found a Payment Bypass Bug Using a Simple Race Condition

The online learning platform checked a user's credit balance and then updated it without locking, so two simultaneous purchase requests could both pass the check and unlock courses even when the user could only afford one. An attacker could obtain multiple courses for the price of one, leaving the balance negative.

medium.com

Published on medium.com

Hi, I’m Krishna Tiwari, and in this blog, I’ll walk you through a Payment Bypass Vulnerability. Due to policies, I can’t disclose the site name.

Krishna, on 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 application performed a check-then-act sequence on the credit balance without atomicity or locking, allowing concurrent requests to both pass the check before either update occurred.

Impact

An attacker could unlock multiple courses while only paying for one, causing financial loss to the platform and unauthorised access to content.

What the attacker needed

A user account with some credits; ability to send concurrent requests

How it was found

  1. Have a user account with a certain number of credits (e.g., 500).
  2. Send two purchase requests for different courses at the same time.
  3. Both requests are processed concurrently and both pass the balance check.
  4. Both courses are unlocked and the balance goes negative.

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 your credit balance) and then updates it, but doesn't stop two actions from happening at the same time. If you send two purchase requests at once, both can see the old balance and both succeed, even though you only had enough credits for one. This lets you get more than you paid for.

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.

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.