Skip to content

Latest commit

 

History

History
49 lines (32 loc) · 2.29 KB

087.md

File metadata and controls

49 lines (32 loc) · 2.29 KB

Obedient Lava Monkey

Medium

Lack of debt ceiling validation in validateUseAsCollateral will cause unchecked over-leveraging for users in isolated mode

Summary

The absence of a debt ceiling check in validateUseAsCollateral will allow users to exceed the maximum debt limit in isolated mode, bypassing protocol safeguards, as the function does not enforce the ceiling constraint.


Root Cause

In ValidationLogic.sol, the validateUseAsCollateral function determines if a reserve can be used as collateral but omits a critical debt ceiling validation for isolated mode. Specifically, the function lacks a check to ensure:

reserve.totalDebt <= reserveConfig.getDebtCeiling()

This oversight allows collateralization even if the total debt of the reserve has already surpassed its configured debt ceiling, breaking isolation mode guarantees and risking over-leveraging. The missing validation leads to unchecked excessive borrowing against reserves, undermining protocol safety.


Internal Pre-conditions

  1. A reserve is configured with a debt ceiling in isolation mode.
  2. A user supplies collateral for that reserve, triggering validateUseAsCollateral.
  3. The reserve’s total debt exceeds its debt ceiling.

External Pre-conditions

  1. Debt ceiling configurations are enabled for the reserve.
  2. The oracle provides correct asset prices for debt and collateral assets.

Attack Path

  1. A user supplies collateral to a reserve in isolation mode.
  2. Despite the reserve’s total debt exceeding its debt ceiling, the protocol allows the collateral to be used without restriction.
  3. The user borrows excessively, risking insolvency or liquidation failures.

Impact

The protocol becomes exposed to excessive debt in isolated reserves, risking insolvency or liquidity imbalances. Other users may face reduced liquidity or borrowing opportunities due to debt cap breaches.


Mitigation

Add a debt ceiling check in validateUseAsCollateral to ensure that the reserve’s total debt remains within the configured limit.