€300 just by bug race condition
The workspace creation limit for free users was checked after the new workspace was already written to the database, leaving a timing gap. By sending many creation requests at once, a free user could end up with more workspaces than the plan allowed.
medium.com
Published on medium.com
Hello bug hunters! It’s been a long time since I wrote, lately I’ve been busy like most young people hahaha, by the way This time I want to tell you about one of the interesting bugs that I managed to find on one of the famous online platforms.
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 inserted the workspace into the database before validating the user's workspace limit, so concurrent requests could all pass the check.
Impact
A free user could exceed the workspace limit and use extra workspaces without paying for the premium plan.
What the attacker needed
A free account at the workspace limit; ability to send parallel requests
The fix
The limit should be checked before the workspace is written to the database, ideally within a single atomic transaction.
How it was found
- Log in with a free account that already has the maximum number of workspaces.
- Go to the workspace creation page and intercept the creation request.
- Duplicate the request into many tabs and send them all in parallel with last-byte synchronisation.
- Check the workspace counter in the UI, which has increased beyond the limit.
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 program does two things in an order that lets someone slip in between them. Here the site saved a new workspace before checking whether the user was allowed to create one, so many requests sent together could all be saved before the check stopped them. The result was extra workspaces for a free account.
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.