Hacking The Like Functionality Of Twitter
Twitter's like endpoint could be hit with many simultaneous requests so that a single like action registered more than once. An attacker could inflate the like count on a tweet beyond the intended one-per-user limit.
Published on infosecwriteups.com
Twitter is a social media platform used by millions of people around the world to share their thoughts, opinions, and experiences. One of its most popular features is the ability to “like” a tweet, which indicates approval or agreement with its content.
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 was not made atomic, so concurrent requests from the same account were each processed before the duplicate was rejected.
Impact
The like count on a tweet could be inflated beyond one per user, which Twitter judged did not affect confidentiality, integrity or availability and did not influence tweet ranking.
What the attacker needed
A Twitter account; ability to intercept requests
The fix
The text does not describe a fix; the behaviour was closed as informative because Twitter already knew about it and considered it non-security.
How it was found
- Intercept the request sent when clicking the like button.
- Send the captured request to Burp's Turbo Intruder.
- Use a script that queues many requests and releases them together through a gate.
- Start the attack and observe the result.
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, but many requests arrive at the same moment before the first one has finished. Here the server did not properly stop several near-simultaneous like requests from the same person, so the counter went up more than once. The result is a fake, inflated like count rather than access to anyone's data.
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.