# IndexTemplate.sol Wrong implementation allows lp of the index pool to resume a locked PayingOut pool and escape the responsibility for the compensation

IndexTemplate.resume() only checks paused() not marketStatus, letting an LP unlock a PayingOut index pool and dodge compensation liability.

- Payout: Audit contest
- Severity: high
- Program: InsureDAO
- Found by: WatchPug
- Disclosed: 2022-03-15
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2022-01-insure-findings/issues/278
- Library page: https://bugbountylibrary.com/r/c4%3A2022-01-insure%3AH-12
- Tags: domain:web3 impact:funds-loss kind:contest platform:code4rena sev:high tech:solidity technique:source-review vuln:access-control vuln:business-logic

**Target:** IndexTemplate.sol index pool contract (Solidity)
**Root cause:** resume() validates only that underlying pools are not paused, ignoring marketStatus, so it can be called while the index pool is in PayingOut state and clears the locked flag.
**Steps:**
1. Enter PayingOut state on the index pool (a claim triggers payout).
2. As an LP, call `resume()` on IndexTemplate.
3. Loop only requires `IPoolTemplate(poolList[i]).paused() == false`, which holds during PayingOut.
4. `locked = false` executes, unlocking the pool and allowing withdrawal before compensation is settled.
**How found:** Code review of the resume() access/state checks against the documented intent that all LPs be locked during PayingOut; noticed the check used paused() instead of marketStatus().
**Exploitation:** A malicious LP waits until the index pool enters PayingOut, calls resume() to clear the locked flag, then withdraws their stake, leaving remaining LPs to cover the compensation shortfall.
**Insight:** When a protocol documents a state-based lock, verify the guard checks the actual state enum (marketStatus) rather than a loosely correlated flag like paused(); mismatched guards let users exit during settlement.
