Obedient Lava Monkey
Medium
Improper Validation of isolationModeTotalDebt
Update in executeBorrow
Allows Exceeding isolationModeDebtCeiling
In BorrowLogic.sol
, improper updating of the isolation mode debt ceiling will cause overexposure for the protocol as the contract will allow borrowing that exceeds the configured debt ceiling.
In BorrowLogic.sol, the isolation mode debt is updated without a check to ensure that the new total debt remains within the isolation mode debt ceiling.
The root cause of the issue is that in the executeBorrow
function, the isolationModeTotalDebt
is incremented with the borrowed amount without checking if this new total exceeds the isolationModeDebtCeiling. This lack of validation allows the total debt in isolation mode to surpass the maximum limit set by the protocol, which should prevent over-borrowing against isolated assets.
- The reserve needs to be in isolation mode.
- The user needs to borrow an amount that, when added to the current
isolationModeTotalDebt
, exceeds theisolationModeDebtCeiling
.
- The external oracle price for the collateral asset remains constant or increases.
- There are no protocol-level safeguards or constraints set on the total debt in isolation mode by other contracts or administrative actions.
- A user calls the
executeBorrow
function with a borrow amount that, when added to the current isolation mode debt, exceeds the configured ceiling. - The
isolationModeTotalDebt
is updated without validation, bypassing the debt ceiling limit. - The borrow is processed successfully, even though it violates the protocol's debt ceiling constraint.
The protocol suffers an increased risk of insolvency due to overexposure to the isolated asset. This can lead to financial loss if the asset value drops, and the debt surpasses the collateral's value, potentially resulting in under-collateralized loans.
Add a validation check to ensure that the updated total debt does not exceed the isolation mode debt ceiling before updating the isolationModeTotalDebt
.