Race condition in Tendermint’s StarPort
A race condition in Tendermint's StarPort faucet allowed a user to bypass the configured maximum withdrawal limit by sending concurrent requests. An attacker could withdraw more tokens than intended.
A few months ago, during an audit of one of CredShields’ clients, we uncovered a race condition in Tendermint’s Starport that allowed any user to bypass the faucet withdrawal limits. This blog post discusses the postmortem of the race condition bug.
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 faucet's transfer function checked the account balance and sent tokens without locking, so concurrent requests could all pass the balance check before any transfer completed.
Impact
An attacker could withdraw more tokens than the faucet's configured limit, potentially draining the faucet.
What the attacker needed
Access to the faucet endpoint; ability to send concurrent requests
How it was found
- Configure the faucet with a maximum credit limit (coins_max).
- Send many concurrent requests to the faucet endpoint using multiple threads.
- Observe that the total tokens withdrawn exceed the configured 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 faucet is a service that gives out small amounts of cryptocurrency for free, often with a limit per address. The bug meant that if someone asked for tokens many times at almost the same moment, the system checked their balance before previous requests had finished, so it allowed more than the limit. This is called a race condition: a timing flaw where simultaneous actions confuse the system.
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.