Lending pool's borrow and withdrawNFT allows undercollateralized positions due to a coding mistake.
LendingPool::withdrawNFT function checks if the remaining collateral leaves a position undercollateralized as below:
Here liquidationThreshold value takes 0.8 in the constructor, which means that remaning collateral value could be 0.8 of a user debt, leaving the position undercollateralized.
The same mistake occurs in LendingPool::borrow:
Undercollateralized positions are allowed, leaving protocol with bad debt.
If statements should be liquidationThreshold * collateralValue < userTotalDebt then revert.
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.