Skip to content
Race condition Write-up Intermediate

Race condition bugs on Facebook

The author found race conditions in Facebook's page review system and username creation, and in DigitalOcean's promo code redemption. By sending many requests simultaneously, an attacker could add multiple reviews, create multiple usernames for one account, or redeem a promo code multiple times to gain credit.

Josip Franjkovic Follow

Published on josipfranjkovic.blogspot.com

Lately I have been looking into race condition bugs affecting websites/web-applications. Here is a good resource to learn about them - includes theory, vulnerable code, proof of concept code and ways to fix.

Josip Franjkovic (@josipfranjkovic), on josipfranjkovic.blogspot.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 application checked a condition and then performed an action without making the two steps atomic, so concurrent requests could both pass the check.

Impact

An attacker could inflate or deflate page ratings, create multiple usernames for a single account, and redeem promo codes multiple times to gain credit; the text notes Facebook did not consider the username issue a security bug, and DigitalOcean allowed keeping test accounts with about $550 total.

What the attacker needed

A Facebook account; a DigitalOcean account; a valid promo code

The fix

The bugs were fixed by Facebook and DigitalOcean, though the text does not describe the fix.

How it was found

  1. Add a review with 5 stars and intercept the add review request.
  2. Send many add review requests in a short time frame.
  3. Observe multiple reviews appear.
  4. Delete one review, then create a new review and repeat to inflate ratings.

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 website checks something (like 'has this user already reviewed?') and then performs an action, but if two requests arrive at almost the same time, both checks may pass before either action is recorded. This lets someone do something multiple times when only one should be allowed, such as submitting many reviews or using a coupon code repeatedly.

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 Josip Franjkovic

View all

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