Obedient Lava Monkey
High
A missing adjustment for effective collateral in isolation mode will cause over-borrowing for borrowers as the protocol will overestimate available collateral, allowing borrowers to take loans exceeding safe thresholds.
In ValidationLogic.validateBorrow
, the function calculates vars.userCollateralInBaseCurrency using all user collateral without filtering for eligibility based on liquidation thresholds or isolation mode constraints. This causes the protocol to overestimate the amount of collateral available to secure a loan, allowing borrowers to exceed safe borrowing limits in isolation mode. The missing logic fails to exclude assets that either:
- Have a zero liquidation threshold (non-liquidatable collateral).
- Are restricted by isolation mode debt ceilings.
- Protocol Admin needs to configure an asset with
isolationModeActive = true
and a non-zerodebtCeiling
. - User needs to supply assets with non-zero liquidation thresholds in isolation mode.
- Collateral Prices from the oracle must remain stable or increase slightly to avoid immediate liquidation.
- User supplies collateral in isolation mode with a high LTV but a non-zero liquidation threshold.
- User attempts to borrow assets using
borrow()
. - The system incorrectly calculates the user’s total collateral, including ineligible collateral, and approves the borrow.
- User withdraws borrowed funds, leaving the protocol under-collateralized.
- The protocol suffers a potential loss of bad debt, as under-collateralized positions cannot be fully liquidated.
- The borrower gains excess borrowing power, effectively draining the reserve.
Adjust the calculation in validateBorrow
to consider only liquidation-threshold-adjusted collateral: