One User, Multiple Votes: A Race Condition
The product rating endpoint accepted several identical rating submissions sent at the same moment from one account, even though the interface blocked a second vote. An attacker could inflate or deflate a product's vote count by replaying the request in parallel.
medium.com
Published on medium.com
Hey Hackers, I am Parth Narula. A penetration tester, bug hunter, red teamer and overall a security researcher.
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 server checked for an existing rating and then inserted the new one without a lock or unique constraint, so parallel requests all passed the check before any insert landed.
Impact
A single account could add multiple votes to a product, so rating totals could be manipulated to make a product look better or worse than genuine user feedback suggests.
What the attacker needed
A free account; access to the rating widget; a proxy that can send requests in parallel
The fix
The server should enforce one rating per user per product with a database unique constraint or atomic check-and-insert, so concurrent requests cannot all succeed.
How it was found
- Open the free products page and use the rating widget to submit a vote.
- Capture the rating submission request in an intercepting proxy.
- Duplicate the captured request into a group of four identical copies.
- Send all four copies in parallel using the proxy's parallel send feature.
- Observe that the server returned success for every copy.
- Reload the page and see the vote count rise by four instead of one.
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 is when a server handles two or more requests at the same instant and its usual checks get confused. Here the website's button stopped you voting twice, but the server behind it did not, so sending the same vote several times at once counted each one. The result is that one person can cast many votes.
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.