Skip to content
Race condition Write-up Intermediate

Race Condition in Upload Quota — Free Storage via Parallel

The platform's storage quota check was not atomic, so two simultaneous uploads could both be accepted even when their combined size exceeded the quota. An attacker could store files beyond the quota without them being counted, potentially causing unexpected storage costs.

MostReal Follow

Published on medium.com

This bug was found during a private program on a platform that provides per-user storage quotas.

MostReal, 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 backend performed quota checks without locking or atomic operations, so concurrent uploads could both pass validation before either was recorded.

Impact

An attacker could store files beyond the quota without them being counted, potentially causing unexpected storage costs if storage is tied to billing or backend resources.

What the attacker needed

A user account with upload access; ability to send two upload requests simultaneously

The fix

The issue was fixed by implementing atomic quota checks before file writes, using locking to prevent simultaneous state conflicts, and treating parallel uploads as transactions that fail if combined size exceeds the limit.

How it was found

  1. Prepare two files of different sizes (90MB and 50MB).
  2. Open two request tabs in Burp Suite and send both upload requests simultaneously.
  3. Observe that the smaller file is counted but the larger file is stored without being counted in the quota.

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 storage quota is a limit on how much data you can save. Normally the system checks the total before accepting a new file. Here, when two uploads arrived at the same moment, the check got confused and let one file through without counting it, so the user got extra free space.

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 MostReal

View all

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