Sei Network
Two critical bugs were found in Sei Network: one could halt the chain by triggering a panic in an ABCI EndBlocker, and the other allowed an attacker to transfer negative amounts and steal funds from any account. The second bug could have let an attacker drain the bonded token pool and take over the validator set.
usmannkhan.com
Published on usmannkhan.com
In April 2024, I found and reported two critical bugs to Sei Network concerning their layer-1 blockchain. One of these issues impacted the chain’s availability, and the other its integrity.
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 first bug was caused by using a balance function that includes locked funds in a transfer that only handles unlocked funds, leading to a panic; the second bug was caused by missing validation of negative amounts in internal EVM calls.
Impact
The first bug could halt the chain, and the second could allow an attacker to steal funds from any account and potentially take over the validator set, but no funds were at risk because the bugs were caught before deployment.
What the attacker needed
Ability to create a vesting account; ability to send EVM transactions; ability to deploy cosmwasm contracts
The fix
The first bug was fixed by replacing GetBalance with SpendableCoins and later removing the panic; the second bug was fixed by adding validation to prevent negative transfers.
How it was found
- Create a vesting account at a deterministic coinbase address with some tokens.
- Send an EVM transaction to Sei to reach the vulnerable code block.
- The coinbase balance will be greater than zero but not entirely transferable, causing a panic and chain halt.
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 blockchain is a shared ledger run by many computers. A bug in its code can let someone crash it or steal funds. Here, one bug could stop the chain from working, and another let someone move negative amounts of money to take funds from others.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.