# Kerosene collateral is not being moved on liquidation, exposing liquidators to loss

VaultManagerV2::liquidate moves only non-Kerosene collateral to liquidator on full liquidation, leaving Kerosene behind and shortchanging the liquidator.

- Payout: Audit contest
- Severity: high
- Program: DYAD
- Found by: 0xAlix2
- Disclosed: 2024-06-17
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2024-04-dyad-findings/issues/128
- Library page: https://bugbountylibrary.com/r/c4%3A2024-04-dyad%3AH-09
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:code4rena sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:business-logic vuln:liquidation

**Target:** VaultManagerV2::liquidate on-chain contract
**Root cause:** The liquidation loop iterates only over non-Kerosene vaults (vaults[id]) and omits vaultsKerosene[id], so Kerosene collateral is never transferred to the liquidator even when the position is fully liquidated (CR < 100%).
**Steps:**
1. Fork mainnet at block 19703450; deploy V2 contracts and fix licenser in addKerosene/getKeroseneValue.
2. Bob: add ethVault + boundedKerosineVault, deposit 1 WETH and 1 Kerosene, mint 2100 DYAD.
3. Alice: add wstEth/eth/boundedKerosine vaults, deposit 1.3 wstETH, mint 3000 DYAD.
4. Halve WETH oracle price so Bob's CR < 100%.
5. Alice calls `vaultManagerV2.liquidate(bobNFT, aliceNFT)`.
6. Assert `getNonKeroseneValue(bobNFT) == 0` but `getKeroseneValue(bobNFT) > 0` — Kerosene remains with Bob.
**How found:** Code review of VaultManagerV2::liquidate: noticed the collateral-move loop iterates `vaults[id]` only, while `getKeroseneValue`/`getNonKeroseneValue` treat Kerosene vaults separately, so full-liquidation path omits Kerosene vaults.
**Exploitation:** Liquidator burns DYAD to repay the underwater Note but receives only the non-Kerosene collateral; the Kerosene portion stays with the liquidated Note, so the liquidator takes a loss on the bonus/repayment while the liquidated position retains residual collateral.
**Insight:** When a protocol splits collateral into multiple vault registries (e.g. non-Kerosene vs Kerosene), audit every loop that iterates one registry against functions that aggregate both — liquidation, withdrawal, and value calculations are prime spots for a missing second loop.

