Easy 2000$ Race Condition
A limited-use discount voucher could be redeemed by several accounts at the same time, so more people received the discount than the voucher allowed. This let participants join teams or tournaments for free or at a reduced price, causing the organisation to lose money.
A few months ago, I was invited to a new Hackerone program. This program is about managing the games of basketball and baseball teams.
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 voucher's remaining-use check and its redemption were not performed atomically, so concurrent requests all passed the check before any redemption was recorded.
Impact
The voucher could be used beyond its configured limit, so the organisation could lose money on discounts and free entries.
What the attacker needed
Several accounts; voucher with a limited number of uses; requests sent simultaneously
How it was found
- Create several accounts that will join the team or tournament.
- Have all of those accounts submit the voucher at the same time.
- Each account receives the discount or free entry even though the voucher was limited.
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 system checks something and then acts on it, and two requests slip through that gap together. Here, the site checked whether a voucher still had uses left, but several accounts sent their requests at the same moment, so each one passed the check before any of them used up the voucher. The result is that a voucher meant for a limited number of people was used by more.
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.