Valid Tokens, Broken Limits: A Race Condition Story
A free account could create more projects than the plan allowed because the server checked the project limit before processing each request but did not enforce it atomically during execution. By sending several project-creation requests at the same time, each with a different valid token, an attacker could bypass the one-project limit and create multiple projects.
During my recent bug hunting activities, I came across a platform (referred to here as ProjectHub to comply with responsible disclosure policies).
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
The application performs a pre-check on the project limit without using atomic operations or locking, so concurrent requests can all pass the check before any project is created.
Impact
The impact is limited to subscription abuse, allowing a free user to create more projects than the plan permits, but similar race conditions could enable billing manipulation or resource exhaustion in other contexts.
What the attacker needed
A free account; ability to send parallel requests
The fix
The application should enforce the project limit atomically during execution, using server-side locking or atomic operations, rather than relying on a pre-check.
How it was found
- Create a free account, which automatically creates one default project.
- Delete the default project so the project count becomes zero.
- Access the project creation page multiple times to collect several valid authenticity tokens.
- Prepare multiple project creation POST requests, each with a different valid token.
- Send all prepared requests simultaneously using Burp Suite's parallel send feature.
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 rule (like 'you can only have one project') but then does the action later, and in between someone can sneak in extra requests. Here, the server checked the limit, but if many requests arrived at once, they all passed the check before any project was actually created, so the limit was broken. The attacker just sent several requests simultaneously to get more projects than allowed.
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.