The LendingPool's borrow function incorrectly applies the liquidation threshold to the debt amount instead of the collateral value, allowing users to borrow more than their collateral can safely secure.
In the LendingPool contract, the collateral check in the borrow function is implemented incorrectly:
This is wrong because the threshold should be based on the collateralValue not the userTotalDebt.
Example Scenario:
collateralValue = 1000
liquidationThreshold = 80%
userTotalDebt = 1200
1000 < ( 1200 * 80% ) = 1000 < 960 = false. (doesn't revert)
After borrow:
collateralValue = 1000
userTotalDebt = 1200
Users can borrow more than their collateral value, exposing the protocol to insolvency risk through accumulated bad debt.
Manual Review
Correct the liquidation threshold check to apply to collateral value
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.