[web3] Critical bug in Oasys found by merkle_bonsai worth 200k
A validator could bypass the system-transaction check by sending slashing calls with a non-zero gas price, allowing them to jail all other validators within one epoch and become the sole validator. This gave them the power to halt the network, control validator admission, and set arbitrary block rewards.
mirror.xyz
Published on mirror.xyz
It is both L2 blockchain and ecosystem that is based on forked Ethereum protocol. It is super-limited, with no possibility to deploy custom contracts, and is specifically aimed to solve blockchain gaming stuff.
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 system-transaction check classified any transaction to a genesis contract with zero gas price as a system transaction, instead of checking the specific contract and method, so a non-zero gas price bypassed it.
What the attacker needed
Become a validator (stake ~$50k); have 40-50 blocks left to validate in the epoch; send transactions with non-zero gas price
The fix
The system-transaction check was changed to verify the specific contract and method instead of relying on gas price.
How it was found
- Deposit around $50k and become a validator.
- Wait until you have at least 40-50 blocks left to validate in the epoch.
- Fill your blocks with calls to StakeManager.slash against every other validator, ensuring gas price is not zero.
- At the end of the epoch, all other validators are jailed and you become the only validator.
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 validator is a computer that approves blocks of transactions. This blockchain had a rule that only special 'system' transactions could call certain functions, but the check was flawed: it treated any transaction to a system contract with zero gas price as a system transaction. By sending the same calls with a tiny non-zero gas price, a validator could make ordinary transactions that still passed the check, letting them abuse a function meant only for system use.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.