Skip to content

Latest commit

 

History

History
43 lines (28 loc) · 2.32 KB

050.md

File metadata and controls

43 lines (28 loc) · 2.32 KB

Obedient Lava Monkey

Medium

Incorrect handling of partially liquidated isolated reserves can break debt ceiling enforcement.

Summary

After a partial liquidation in an isolated reserve, the system does not properly adjust the isolation mode debt tracking to reflect the reduced debt, leading to potential breaches of the debt ceiling in future operations.


Root Cause

In LiquidationLogic.sol (within executeLiquidationCall), the function IsolationModeLogic.updateIsolatedDebtIfIsolated is called only after the liquidation is complete, but it does not accurately reflect the reduced actualDebtToLiquidate during partial liquidations. The isolationModeTotalDebt remains unchanged or improperly updated, causing inaccuracies in debt ceiling enforcement.


Internal Pre-conditions

  1. A reserve is configured as isolated with an active debt ceiling (reserveConfiguration.getIsolated() is true).
  2. The user’s position is partially liquidated (actualDebtToLiquidate < userReserveDebt).
  3. IsolationModeLogic.updateIsolatedDebtIfIsolated fails to properly adjust the reserve’s isolationModeTotalDebt.

External Pre-conditions

None (assumes no external dependencies on this logic).


Attack Path

  1. A user with an isolated reserve is partially liquidated.
  2. The protocol does not properly adjust the isolationModeTotalDebt for the isolated reserve after the partial liquidation.
  3. Future borrowing or liquidations proceed, assuming the outdated isolationModeTotalDebt.
  4. The debt ceiling is unintentionally exceeded due to stale tracking.

Impact

The protocol’s isolation mode guarantees are broken, potentially leading to over-leverage within isolated reserves. This could expose the entire protocol to systemic risks that isolation mode was designed to contain.


Mitigation

Ensure IsolationModeLogic.updateIsolatedDebtIfIsolated accurately subtracts actualDebtToLiquidate from the isolationModeTotalDebt during partial liquidations.