Obedient Lava Monkey
Medium
Incorrect LTV validation in validateHFAndLtv
will cause improper collateral assessment for users, leading to invalid rejections
The reliance on zero-LTV collateral checks in validateHFAndLtv
will cause unintended rejections of valid user actions for users when collateral assets with non-zero LTV are incorrectly flagged due to a mismatch in collateral and reserve configuration.
In ValidationLogic.sol
, the validateHFAndLtv
function assumes that collateral with zero LTV (Loan-to-Value) cannot coexist with reserves having non-zero LTV configurations. Specifically, the check:
require(
!hasZeroLtvCollateral || reserve.configuration.getLtv() == 0,
Errors.LTV_VALIDATION_FAILED
);
fails to account for cases where users may hold valid non-zero LTV reserves alongside zero-LTV assets. This causes actions like borrowing or withdrawing to be incorrectly flagged as invalid if any collateral in the user's portfolio has a zero LTV, rather than evaluating the portfolio as a whole.
- A reserve with non-zero LTV exists in the system.
- A user holds collateral marked as zero-LTV due to specific configuration but attempts an action requiring reserve LTV validation.
- The oracle must report correct prices for the user’s collateral and debt assets.
- Protocol configurations do not disable zero-LTV reserves by design.
- A user supplies collateral with a non-zero LTV reserve but with zero-LTV configuration on the user side.
- The protocol incorrectly flags the user's position as invalid due to the
validateHFAndLtv
zero-LTV check. - Actions such as borrowing, withdrawing, or repaying are incorrectly rejected.
Users cannot borrow or use their collateral properly despite meeting all other reserve requirements, leading to unnecessary.
Refactor validateHFAndLtv
to ensure that zero-LTV collateral is only flagged if all reserves in the user’s portfolio are zero-LTV, and actions dependent on LTV are explicitly checked against valid reserves.