In the borrow function of the LendingPool contract, the collateral check contains an off-by-one error in its inequality comparison. The current implementation uses a strict less-than (<) comparison when verifying if the collateral value meets the liquidation threshold requirement.
This allows a scenario where:
collateralValue == userTotalDebt.percentMul(liquidationThreshold)
to pass the check and enable borrowing, even though this represents the exact liquidation threshold where the position should be considered unsafe.
Allows creation of immediately liquidatable positions
Users can borrow up to the absolute maximum without safety margin
Puts protocol funds at risk if asset prices decrease even slightly
Violates core protocol safety mechanisms designed to maintain over-collateralization
Modify the inequality check to use less-than-or-equal-to:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.