Skip to content
Race condition Write-up Intermediate

How I found a Race condition on Like Function

The like function on uploaded photos could be abused by sending many identical like requests at once, so a single user could register multiple likes on the same item. The author reports this as a high-impact race condition because the application's rating of images and videos depended on like counts.

zodiac0x Follow

Published on zodiac0x.medium.com

Welcome back everyone! I am Omar Islam, known as Zodiac0x.

Zodiac, on zodiac0x.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

Likely the like action checked for an existing like and then inserted a new one without doing both atomically, so concurrent requests all passed the check.

Impact

A single user could inflate the like count on an image or video, which could distort the application's rating of that content.

What the attacker needed

A user account able to upload and like; ability to intercept and replay requests

How it was found

  1. Upload a photo to the application.
  2. Intercept the traffic and click the like button.
  3. Send the captured like request to the repeater and duplicate it many times.
  4. Send all the duplicated requests together as a single packet attack.

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 acts on it, and two requests slip through that check at the same moment. Here, the site probably checked whether you had already liked a photo, but many copies of the like request arriving together all passed the check before any of them was recorded. That let one person add many likes to the same photo instead of just one.

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.