Race Condition - A cURL Chaos
A plan-limited invitation counter could be bypassed by sending several invitation requests at the same moment, so more invitations were accepted than the plan allowed. An attacker on a basic plan could therefore send invitations reserved for the premium tier.
Published on shahjerry33.medium.com
Race condition vulnerability occurs when websites process requests concurrently. Race conditions typically occurs in multi-threaded or multi-process environments where multiple threads or processes are competing for shared resources.
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 check of the remaining invitation count and its decrement were not atomic, so concurrent requests all read the same value before any update was written.
Impact
A basic-plan user could send more invitations than their plan allows, reaching limits meant for the premium tier and affecting the business model; the author rates it low severity.
What the attacker needed
A basic-plan account; a few invitations already used; ability to run cURL
The fix
The counter update should be made atomic or transactional so the check and decrement happen as one indivisible step.
How it was found
- Open the invitation feature with only a few invitations left on the plan.
- Add an address and capture the invitation request from the browser network tab.
- Copy the request as a cURL command and remove the Windows line-continuation characters.
- Repeat the same request several times in one command, each with a different address.
- Run the combined command in a terminal so the requests fire together.
- Observe that more invitations were accepted than the remaining allowance.
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 a limit and then updates it as two separate steps. If several requests arrive at almost the same instant, they can all pass the check before any of them updates the counter, so the limit is exceeded. Here the invitation counter was read by many requests at once and each one believed there was still room.
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.