The LendingPool::depositNFT
function does not check if a user is under liquidation and if their grace period has expired. This allows users to deposit additional NFTs in an attempt to increase their health factor, but if they fail to close the liquidation because of the grace period expiration, they will lose all collateral including the newly deposited NFTs.
The LendingPool::depositNFT
function lacks checks for:
Whether the user is under liquidation (isUnderLiquidation[msg.sender]
)
Whether their grace period has expired (block.timestamp > liquidationStartTime[msg.sender] + liquidationGracePeriod
)
This allows users to deposit additional NFTs even when their position is already eligible for liquidation and after the grace period has expired, resulting in the loss of more collateral than necessary.
Users under liquidation can lose additional collateral by attempting to save their position after the grace period has expired. Since finalizeLiquidation()
transfers all NFTs to the Stability Pool, any newly deposited NFTs will also be liquidated, causing users to lose more value than their original debt.
For example:
User has 100k debt and 125k in NFT collateral
Position becomes liquidatable and grace period expires
User deposits additional 50k NFT trying to save position
Liquidation executes, user loses 175k collateral to cover 100k debt
Manual review
Add the following test case to the test/unit/core/pools/LendingPool/LendingPool.test.js
file in the Liquidation
section:
Add liquidation status checks to the depositNFT
function:
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.