The LendingPool::borrow
function incorrectly applies the liquidation threshold to the debt value instead of the collateral value when verifying loan-to-value ratios. This inversion enables borrowers to take out loans that exceed their collateralized limits, violating protocol safety parameters.
User deposits NFT valued at 100 crvUSD (liquidationThreshold = 80%)
Existing debt after borrowing: 90 crvUSD
Protocol incorrectly calculates:
Faulty check: 100 ETH < (90 ETH * 80%) → 100 < 72 → false
Proper check: (100 ETH * 80%) < 90 ETH → 80 < 90 → true
Borrow allowed despite exceeding 80 crvUSD collateralized limit
Relevant code snippet:
Test case to demonstrate vulnerability:
In LendingPool.test.js
, add this test and run npx hardhat test --grep "allows borrowing beyond collateral limits"
High severity - Allows creation of immediately undercollateralized positions, putting both borrower assets and protocol liquidity at risk. Violates core lending safety mechanisms.
Core fix: Apply liquidation threshold to collateral value instead of debt
Validation enhancement: Add pre/post checks for collateral health factor
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.