# Changing Entropy Provider During Active Drawing Causes Permanent Protocol Lock and Callback Failure

Admin changing entropy provider or other config mid-drawing causes callback revert, permanently locking the jackpot and preventing settlement.

- Payout: Contest reward
- Severity: medium
- Program: Megapot
- Credited: Alex_Cipher
- Disclosed: 2026-01-05
- Write-up quality: 6/10
- Original: https://code4rena.com/reports/2025-11-megapot#m-07
- Library page: https://bugbountylibrary.com/r/c4%3A2025-11-megapot%3AM-07
- Tags: domain:web3 impact:dos impact:funds-loss kind:contest platform:code4rena sev:medium technique:source-review vuln:access-control vuln:business-logic vuln:dos

**Target:** Jackpot smart contract
**Root cause:** Settlement logic reads mutable admin-controlled parameters (entropy provider, LP manager, payout calculator, fees) at callback time rather than snapshotting them at draw start, so mid-draw changes can cause reverts or alter outcomes.
**Steps:**
1. Deploy Jackpot with normal entropy provider and LP manager.
2. Initialize LP deposits and jackpot, buy tickets, call `runJackpot` to request randomness.
3. Admin calls `setEntropy(maliciousProvider)` where malicious provider's `randomnessCallback` reverts.
4. Callback from malicious provider reverts, drawing ID unchanged, funds locked.
5. Alternatively, change `protocolFee`, `payoutCalculator`, or `referralFee` before callback to alter settlement amounts.
**How found:** Auditor reviewed admin functions and noticed they lack restrictions during active drawings, then wrote PoCs to demonstrate that changing these parameters before callback causes reverts or altered settlement.
**Exploitation:** A malicious or compromised admin can set a reverting entropy provider or LP manager after a draw is requested, causing all callbacks to fail and permanently locking the jackpot's funds. Alternatively, changing fee or payout parameters mid-draw distorts protocol fees, user winnings, or refunds.
**Insight:** Look for admin-settable parameters that are read during settlement but can be changed after a draw is initiated; snapshotting them at draw start prevents mid-draw manipulation and DoS.
