Skip to content
Race condition Write-up Intermediate

Exploiting Race Conditions in GraphQL: A Case Study of Follower C

The GraphQL follow mutation did not synchronise concurrent requests, so many parallel follow requests were each counted even though only one follow relationship existed. An attacker could inflate any account's displayed follower count to thousands while the real follower list stayed tiny.

Soltan Maharramov Follow

Published on medium.com

While participating in a bug bounty program, I discovered a critical race condition vulnerability in the GraphQL API of a popular video platform. This vulnerability allowed attackers to artificially inflate the number of followers on any user account without authorization.

Soltan Maharramov, 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

Likely the follow mutation was not idempotent and the counter update ran without transaction isolation or a uniqueness check, so concurrent requests each incremented the count.

Impact

An attacker could inflate any account's displayed follower count, and the fake followers persisted even after unfollowing, with the attack repeatable to keep increasing the number.

What the attacker needed

An account on the platform; mobile app traffic interception; ability to send many parallel requests

The fix

The mutation should be made idempotent with a unique database constraint on the user and channel pair, proper transaction isolation, and request deduplication.

How it was found

  1. Intercept the follow request sent by the mobile app through a proxy.
  2. Duplicate the captured request many times in the repeater.
  3. Send all duplicated requests in parallel using last-byte sync.
  4. Mix in a smaller number of unfollow requests, since follow-only batches failed.
  5. Observe the inflated follower count while the real follower list stays the same.

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 handles several actions at the same moment and gets confused about the order. Here the server counted every follow request it received at once, instead of noticing the person was already following. So a user could make their follower number look huge without real people following them.

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.