Skip to content
Race condition Write-up Beginner

How a YouTube Recommendation Led Me to Claim Free Coins Twice

A free-coins reward endpoint checked eligibility and updated the claim counter in separate, unlocked steps, so parallel requests could all pass the check before any counter update. An attacker could claim the periodic reward more than once, inflating in-game currency.

medium.com

Published on medium.com

It was a random Monday. Nothing special going on.

Gombos Ákos-Roland, 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

The eligibility check and the claim-counter update were not atomic, leaving a time-of-check to time-of-use window.

Impact

Multiple claims could be processed in the same window, and at scale across accounts this could inflate the in-game economy; the text does not say whether a defence limited it.

What the attacker needed

A valid account and auth token; ability to send parallel HTTP/2 requests

The fix

The check and the write should be made a single atomic database operation, or guarded by a lock keyed on the user.

How it was found

  1. Send a request to the free-coins endpoint with a valid token and note the normal response.
  2. Duplicate the request into many tabs in Burp Repeater using the same auth token.
  3. Send the group in parallel over HTTP/2 so the requests arrive nearly simultaneously.
  4. Observe the claim count increase by more than one and the available budget go 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 program checks something and then changes it, but doesn't lock the two steps together. If many requests arrive at the same moment, they can all pass the check before the first one updates the record. Here that meant the free-coins reward could be claimed twice instead of 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.