Race conditions on Facebook, DigitalOcean and others (fixed)
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 submit multiple reviews, create multiple usernames for one account, or redeem a promo code multiple times to add credit repeatedly.
Published on josipfranjkovic.blogspot.hk
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.
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, or obtain multiple credits from a single promo code, potentially gaining monetary value.
What the attacker needed
A Facebook account; a DigitalOcean account; a valid promo code
The fix
The issues were fixed by the respective companies, though the exact fix is not described.
How it was found
- Go to a Facebook page and add a review while intercepting the add-review request.
- Send many copies of that request in a very short time.
- Observe that multiple reviews from the same account appear.
- Delete one of your reviews and then add another review, repeating the process to inflate the rating.
- For DigitalOcean, create an account and find a working promo code.
- Submit the promo code redemption request many times concurrently to add credit multiple times.
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 moment, both checks can pass before either action is recorded. This lets someone do something multiple times that should only be allowed once, such as adding several reviews or reusing a coupon.
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.