My Weirdest Finding: A Race Condition Story
A referral code that was meant to be redeemable only once could be redeemed many times because the server checked whether the code was used before marking it used, leaving a race window. An attacker could send many redemption requests at the same instant to receive repeated account credit.
This is the story of the weirdest bug I’ve pulled off, and honestly the most fun. It’s a race condition — a bug that only exists in the tiny gap between “check” and “do.” Let me make it make sense.
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
The server performed a check-then-act sequence without making the check and the update atomic, so concurrent requests could all pass the check before any marked the code as used.
Impact
The once-only limit on referral codes could be bypassed, allowing an attacker to obtain multiple account credits from a single code; the author demonstrated only a handful of redemptions and did not drain real value.
What the attacker needed
A valid referral code; ability to send concurrent requests
How it was found
- Capture the redeem referral request in Burp.
- Send it to Repeater and add about 30 copies to a group.
- Use Send group in parallel (single-packet attack) so all requests hit the server at the same instant.
- Observe the credit balance to see multiple redemptions instead of one.
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 is when a program checks something and then acts on it, and an attacker slips extra requests into the tiny gap between those two steps. Here the server checked if a referral code was already used, then marked it used; by firing many requests at once, all of them passed the check before any was marked. The result was multiple credits from a code that should work only 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.