# LPP metadata can be altered after the challenge period is over, allowing incorrect states to be proven

Re-calling initLPP after challenge period mutates finalized LPP claimedSize/partOffset, letting a dishonest claimant prove an incorrect MIPS state and win fault dispute games.

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

**Target:** PreimageOracle.sol initLPP/squeezeLPP in contracts-bedrock cannon
**Root cause:** initLPP reads existing proposalMetadata from storage instead of initializing empty, so re-calling it overwrites partOffset/claimedSize while preserving the finalization timestamp; squeezeLPP lacks a bytesProcessed==claimedSize check.
**Steps:**
1. Create LPP via `initLPP(uuid, 132, 136)` with bond, populate via `addLeavesLPP`, finalize and wait past challengePeriod.
2. Re-call `initLPP(uuid, 132, 125)` with MIN_BOND_SIZE to overwrite claimedSize while timestamp stays set.
3. Call `squeezeLPP` immediately; preimageLengths stored as 125 instead of 136.
4. Feed the altered preimage into MIPS read syscall at offset 132; fewer bytes copied, producing a different memRoot/postState than honest oracle.
**How found:** Followed up on Spearbit 5.2.5 noting LPP re-initialization; reading initLPP saw L431 reads storage instead of empty init, and noticed squeezeLPP relies on finalization-time size check, enabling post-challenge mutation.
**Exploitation:** Attacker finalizes a valid LPP, waits out the challenge window, re-invokes initLPP to shrink claimedSize (or shift partOffset), then squeezes immediately with no chance to challenge, causing the MIPS VM to compute a divergent state hash and win the fault dispute game, taking honest bonds.
**Escalation:** Chaining three issues (re-init, stale metadata read, missing squeeze check) turns a benign re-init into state-root forgery in the dispute game.
**Insight:** When a prior report flags a missing existence check, audit what the re-init path actually writes: reading existing struct from storage before setting fields preserves stale fields (timestamps) and lets you mutate finalized state; also check whether downstream consumers re-validate invariants like bytesProcessed==claimedSize.

