Skip to content
Race condition Write-up Intermediate

Race Condition in Withdrawal Function: From Discovery to POC

A withdrawal endpoint was vulnerable to a race condition: sending several requests at the same time let the attacker complete more than one withdrawal before the balance was updated. This allowed withdrawing more money than the account actually held.

medium.com

Published on medium.com

Hi everyone! 👋 This is my first write‑up on Medium, and I’m excited to share a vulnerability I found during a pen test project.

Goris, 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 balance check and the balance update were not performed atomically, so concurrent requests could all pass the check before any of them reduced the balance.

Impact

An attacker could withdraw more funds than their balance allowed, causing a direct financial loss to the service.

What the attacker needed

A valid user account; ability to send concurrent requests

The fix

The withdrawal should be fixed by using locking mechanisms or atomic database operations so the balance check and deduction happen as one indivisible step.

How it was found

  1. Find the withdrawal endpoint and capture a valid withdrawal request.
  2. Send several copies of that request at the same time using Burp Intruder.
  3. Observe that more than one withdrawal succeeds before the balance is updated.

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 two requests can slip in between those two moments. Here, the server checked the balance, then paid out, and a second request could be checked against the old balance before the first payout was recorded. The result is that the same money can be taken out more than once.

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.