# Malicious challenger can brick `finalizeTimestamp` of unfinalized batches

Permissionless challenge/prove cycle in MorphL2 Rollup repeatedly extends finalizeTimestamp of all unfinalized batches by proofWindow, delaying finalization ~74 days.

- Payout: Audit contest
- Severity: medium
- Program: Morphl2
- Found by: DeltaXV
- Disclosed: 2024-08-28
- Write-up quality: 7/10
- Original: https://github.com/sherlock-audit/2024-08-morphl2-judging/issues/145
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-08-morphl2%3AM-5
- Tags: area:web3 domain:web3 impact:dos kind:contest platform:sherlock sev:medium tech:evm tech:solidity technique:chained technique:source-review vuln:business-logic vuln:dos

**Target:** L1 Rollup contract challengeState/proveState
**Root cause:** challengeState unconditionally adds proofWindow to finalizeTimestamp of every other unfinalized batch with no cap, and proveState lets the same actor immediately resolve the challenge, so the cycle can be repeated.
**Steps:**
1. Pre-generate ZK proofs for multiple unfinalized batches.
2. Call `challengeState(batchIndex)` to open a challenge, extending finalizeTimestamp of all other unfinalized batches by proofWindow (2 days).
3. In the next block call `proveState` with the pre-generated proof to finish the challenge and clear `inChallenge`.
4. Repeat steps 2-3 across ~37 batches within a 15-minute window (~75 blocks, 2 blocks per cycle).
5. Each cycle adds 2 days to every other batch's finalizeTimestamp, accumulating ~74 days of delay per batch.
**How found:** Code review of challengeState loop noticed the unconditional `finalizeTimestamp += proofWindow` with no cap, combined with permissionless proveState allowing immediate challenge resolution and repeatability.
**Exploitation:** Attacker needs ~37 ETH to post challenge deposits (risking ~1 ETH) and pre-computed ZK proofs; loops challengeState/proveState to repeatedly bump finalizeTimestamp of all unfinalized batches, and claimReward lacks whenNotPaused so funds can't be frozen.
**Escalation:** Uncapped accumulation of delay across all unfinalized batches, halting L2 finalization for extended periods.
**Insight:** When a state-mutating loop over all pending items runs on every challenge, check whether the same actor can open and immediately close the challenge cheaply; unbounded per-cycle side effects on unrelated items compound into griefing.

## Proof of concept (copied exactly from the original report)

**challengeState loop extending finalizeTimestamp**

```
for (uint256 i = lastFinalizedBatchIndex + 1; i <= lastCommittedBatchIndex; i++) {
            if (i != batchIndex) {
                batchDataStore[i].finalizeTimestamp += proofWindow;
```

**proveState marks challenge finished and clears inChallenge**

```
// Mark challenge as finished
        challenges[_batchIndex].finished = true;
        inChallenge = false;
```

