# An attacker can bypass the challenge period during LPP finalization

Uninitialized metadata.timestamp in Optimism's PreimageOracle lets a submitter skip the LPP challenge period and finalize invalid large preimage proposals.

- Payout: Audit contest
- Severity: high
- Program: Optimism
- Found by: alexfilippov314
- Disclosed: 2024-08-16
- Write-up quality: 8/10
- Original: https://github.com/code-423n4/2024-07-optimism-findings/issues/13
- Library page: https://bugbountylibrary.com/r/c4%3A2024-07-optimism%3AH-05
- Tags: area:web3 domain:web3 impact:integrity kind:contest platform:code4rena sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:business-logic

**Target:** PreimageOracle LPP finalization (squeezeLPP/addLeavesLPP)
**Root cause:** initLPP never sets metadata.timestamp; it is only set in addLeavesLPP when _finalize=true, which is never required. squeezeLPP's check `block.timestamp - metaData.timestamp() <= CHALLENGE_PERIOD` passes trivially when timestamp is 0.
**Steps:**
1. Call `initLPP{value: MIN_BOND_SIZE()}(uuid, 0, claimedSize)` — timestamp stays 0.
2. Call `addLeavesLPP(uuid, 0, LibKeccak.padMemory(phonyData), stateCommitments, false)` with `_finalize=false` so timestamp remains unset.
3. Immediately call `squeezeLPP(...)` with crafted pre/post state and proofs; the ActiveProposal check does not revert.
4. Bond is returned and `preimagePartOk(finalDigest,0)` becomes true with a phony preimage part, poisoning MIPS.sol data.
**How found:** Code reading of squeezeLPP's challenge-period check revealed metadata.timestamp is only written under `_finalize=true` in addLeavesLPP, and nothing forces that flag; hypothesis confirmed with a Foundry PoC.
**Exploitation:** Attacker submits a large preimage proposal with mismatched state commitments, never sets _finalize, then calls squeezeLPP in the same block to finalize an invalid proposal, reclaiming the bond and registering a forged preimage part usable by MIPS.sol.
**Escalation:** Forged preimages let attacker challenge valid claims and forge unchallengeable invalid claims, breaking the fault dispute game.
**Insight:** When a guard compares against a stored timestamp, verify every path that initializes that field; a flag-gated setter (like `_finalize`) that is optional in the flow leaves the guard trivially satisfiable at zero.

