# Worsening liquidations create bad debt

K2 liquidation never checks post-liquidation health factor, so liquidators repeatedly seize bonus collateral from borderline positions, worsening solvency until protocol absorbs bad debt.

- Payout: Contest reward
- Severity: high
- Program: K2
- Credited: v12
- Disclosed: 2026-08-20
- Write-up quality: 7/10
- Original: https://code4rena.com/reports/2026-04-k2#h-01
- Library page: https://bugbountylibrary.com/r/c4%3A2026-04-k2%3AH-01
- Tags: domain:web3 impact:funds-loss impact:integrity kind:contest platform:code4rena sev:high tech:rust technique:source-review vuln:accounting-error vuln:business-logic vuln:liquidation

**Target:** Soroban/Rust lending router liquidation module (contracts/kinetic-router/src/liquidation.rs)
**Root cause:** internal_liquidation_call validates only pre-liquidation health and close factor, never recomputing the borrower's post-liquidation health factor to enforce the 'HF must improve' invariant before finalizing state and socializing deficit.
**Steps:**
1. Identify borrower with HF in band [0.5, LT*(1+bonus)) i.e. below 0.8925 for LT=8500, bonus=500, but above 0.5 close-factor floor.
2. Call liquidation with 50% close factor via `internal_liquidation_call`.
3. Observe collateral seized with bonus exceeds debt burned, lowering HF further.
4. Repeat liquidation each step until collateral exhausted.
5. Function burns remaining debt and books it as `reserve_deficit`, socializing loss to protocol.
**How found:** Code review of liquidation.rs noting the function only checks pre-state health and close factor; cross-referenced repo comments/tests describing a safe partial-liquidation zone above LT*(1+bonus), revealing the reachable band where 50% liquidation worsens HF.
**Exploitation:** Liquidator repeatedly calls liquidation on borderline-unhealthy borrowers within the 50% close-factor zone; each call seizes bonus collateral faster than debt is repaid, worsening HF, until collateral is exhausted and residual debt is written to reserve_deficit while liquidator keeps bonuses.
**Escalation:** Iterative repeated liquidations compound solvency degradation, converting a partial-liquidation into full bad-debt socialization.
**Insight:** When a lending protocol documents a 'HF must improve' invariant, verify the code actually recomputes post-state HF; the dangerous band is between the close-factor floor and LT*(1+bonus), where max-size liquidations are net-negative for solvency.
