# After debt seizure from InsuranceFund, user can dilute all past participants.

After a bad-debt seizure empties the InsuranceFund, an attacker deposits 1 vUSD to mint 1e36 shares, diluting all prior LPs.

- Payout: Audit contest
- Severity: medium
- Program: Hubble
- Found by: 0xliumin
- Disclosed: 2022-06-02
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2022-02-hubble-findings/issues/129
- Library page: https://bugbountylibrary.com/r/c4%3A2022-02-hubble%3AM-06
- Tags: domain:web3 impact:funds-loss kind:contest platform:code4rena sev:medium tech:solidity technique:source-review vuln:accounting-error vuln:share-inflation

**Target:** InsuranceFund.sol deposit/share accounting
**Root cause:** Share minting uses current pool balance as denominator; after seizeBadDebt drains vusd to near-zero, a tiny deposit mints an enormous share count, diluting existing LPs.
**Steps:**
1. Alice deposits 1e18 vUSD, receives 1e18 shares.
2. `seizeBadDebt(2e18)` sets pendingObligations=1e18 and leaves 0 vUSD in fund.
3. Bob transfers 1e18+1 vUSD directly to the fund.
4. Bob calls `deposit(1e18)`; pending obligations settle, leaving 1 vUSD before his deposit.
5. Bob receives shares = 1e18 * 1e18 / 1 = 1e36, diluting Alice.
**How found:** Code review of InsuranceFund deposit math combined with the seizeBadDebt flow; noticed denominator collapses to ~1 after seizure.
**Exploitation:** Attacker waits for a bad-debt seizure to drain the fund, then front-runs recovery with a minimal deposit to mint exponentially more shares than prior LPs, capturing future profits.
**Insight:** In share-based pools, check the mint formula against states where total assets are drained to near-zero (e.g. after loss socialization); a 1-wei denominator mints astronomically many shares.
