# Attacker can freeze chain and steal challenge deposits using fake `prevStateRoot`

Unvalidated prevStateRoot in commitBatch lets a sequencer commit a batch on a fake root, win challenges with a valid proof, and halt the chain.

- Payout: Audit contest
- Severity: high
- Program: Morphl2
- Found by: PapaPitufo
- Disclosed: 2024-08-28
- Write-up quality: 7/10
- Original: https://github.com/sherlock-audit/2024-08-morphl2-judging/issues/84
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-08-morphl2%3AH-2
- Tags: area:web3 domain:web3 impact:dos impact:funds-loss kind:contest platform:sherlock sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:business-logic vuln:dos

**Target:** L2 rollup Rollup.sol commitBatch/finalizeBatch
**Root cause:** prevStateRoot is only checked against finalizedStateRoots in finalizeBatch(), not at commitBatch(), so a batch can be committed atop a fake previous state root.
**Steps:**
1. Attacker (sequencer) calls `commitBatch()` with a batch whose `prevStateRoot` is fake but whose state transition is internally valid.
2. Honest challenger challenges the batch; attacker submits a valid proof of the state transition from the fake root and wins the challenge, taking the challenger's deposit.
3. Batch cannot be finalized because `finalizedStateRoots[_batchIndex - 1] != prevStateHash` reverts in `finalizeBatch()`.
4. Since batches finalize sequentially, no subsequent batch can be finalized; chain halts pending admin rollback.
**How found:** Reasoned about the economic incentive assumption that invalid batches lose challenges; noticed prevStateRoot validation only occurs in finalizeBatch, so commit-time acceptance of fake roots breaks the slashing assumption.
**Exploitation:** Malicious sequencer commits a batch with a fabricated prevStateRoot containing a valid state transition. If challenged, they win via valid proof and seize the challenger's deposit; regardless, the batch is unfinalizable, blocking all later finalizations until admins manually roll back.
**Escalation:** Winning the challenge avoids slashing while simultaneously freezing the chain, combining theft with liveness denial.
**Insight:** When a validity check is deferred to finalization, ask whether the same field gates commit-time acceptance and challenge outcomes; a fake parent root can make a batch both challenge-winning and unfinalizable.

