[web3] Acala Block Production Shutdown Bug Fix Review
The Homa module processed all redeem requests in a single unbounded loop during block initialisation, so an attacker could flood the queue with many small requests from different accounts and make block production exceed the time limit, halting the parachain.
immunefi.com
Published on immunefi.com
Acala, a Polkadot parachain, received a report from whitehat @Lastc0de on Immunefi and quickly patched the vulnerability that could have allowed an attacker to fully stop block production on the parachain.
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 redeem request processing loop had no upper bound on the number of entries it would iterate over in a single block.
Impact
The attack could stop block production on the Acala parachain, and recovering would require a governance-approved fork that could take 15–24 days, during which the network would be down.
What the attacker needed
Possession of at least 12,000 DOT; Ability to create 22,000 wallets; Timing with the 24-hour redeem cycle
The fix
The vulnerability was fixed by limiting the number of redeem requests processed per call.
How it was found
- The attacker obtains at least 12,000 DOT.
- The attacker waits for the 24-hour redeem cycle to begin.
- The attacker distributes the minimum redeem amount to 22,000 different wallets.
- Each of the 22,000 wallets submits a redeem request.
- All requests are added to the RedeemRequests map.
- The validator calls on_initialize, which iterates through the massive map in a for loop, exceeding the block time limit and halting the parachain.
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 needs to process transactions quickly to keep producing blocks. Here, a function that runs at the start of each block went through every withdrawal request one by one without a cap. By creating thousands of tiny requests, an attacker could make that function take too long, so validators could not finish the block in time and the chain stopped.
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.