Race Condition (TOCTOU) in Review API — Bypassing Business Logi
The review API checked for an existing review before writing, so parallel requests could all pass the check and create duplicate reviews. An attacker could submit many reviews for the same organisation from one account, potentially manipulating ratings or flooding the moderation queue.
Md Tanjimul Islam Sifat Follow
Published on medium.com
A Race Condition happens when a system’s behavior depends on the timing of multiple operations — and those operations happen so close together that the system doesn’t have time to process the first one before the second one arrives.
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
Impact
An attacker could create many duplicate reviews from one account, potentially inflating or damaging an organisation's rating and flooding the admin approval queue, though all reviews required admin approval before becoming public.
What the attacker needed
A free account; HTTP/2 support on the server; ability to send parallel requests
The fix
The issue was fixed by adding a database-level unique constraint on the combination of organisation and reviewer, with optional transaction locking or atomic upsert as alternatives.
How it was found
- Log in and go to an organisation's review page, then intercept the review submission request.
- Send the request to Repeater and duplicate it several times.
- Group the duplicated requests into a single tab group.
- Change the send mode to send the group in parallel using the single packet attack.
- Send the group and observe that all requests return 201 Created with different record IDs.
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 system checks something and then acts, but another request sneaks in between the check and the action. Here, the server checked if you already reviewed an organisation, but if many requests arrived at once, they all saw 'no review yet' and all got saved. This let one person post many reviews for the same organisation.
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.