Stacks Dos Bug Fix Review
A flaw in the Clarity virtual machine caused an unhandled exception when a contract was absent, crashing Stacks nodes. An attacker could send a malicious smart contract transaction to disrupt the network.
immunefi.com
Published on immunefi.com
On November 17, 2023, an independent researcher who goes by the pseudonym Catchme reported a Critical vulnerability to Immunefi. This vulnerability was found to be targeting Stacks, a layer 2 for Bitcoin that enables smart contracts and decentralized applications using Bitcoin’s secure base layer.
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 Clarity virtual machine used an unchecked expectation (`.expect()`) when a contract was absent, causing an unhandled exception instead of returning a handled error.
Impact
An attacker could crash Stacks client nodes by sending a transaction with a malicious smart contract, disrupting the network.
What the attacker needed
Ability to send a transaction to the Stacks network
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.
Stacks is a system that runs smart contracts on top of Bitcoin. A smart contract is a small program stored on a blockchain. The bug meant that if a program tried to use a missing contract, the software did not handle the error properly and the whole node crashed. An attacker could send a special transaction to trigger this crash.
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.