The LendingPool::finalizeLiquidation function does not determine the number of NFTs required to cover the user's debt before transferring them to the StabilityPool. Instead, it transfers all deposited NFTs, potentially resulting in excessive collateral loss for the user.
The function LendingPool::finalizeLiquidation iterates over all of user.nftTokenIds and transfers them to the StabilityPool.
There is no calculation to determine how many NFTs are actually needed to cover the outstanding debt.
This can result in more NFTs being transferred than necessary, leading to an unfair liquidation process.
Users may lose more collateral than required to settle their debt.
The system might unintentionally overcompensate the Stability Pool, creating an imbalance in liquidation rewards.
This could lead to reduced user trust and potential legal or regulatory issues.
PoC
user2 deposits 1000 ether worth of crvusd into the lendingPool.
user1 deposits one NFT into the lendingPool.
user1 borrows 125 ether from the lendingPool.
liquidation is triggered on user1's loan.
user1 deposits additional two NFT after liquidation initiation.
The contract time advances by 5 days.
The stability pool finalizes the liquidation.
All 3 NFTs of user1 are transfered from lending pool to the stability pool even though only the first one was used for collateral
Manual code review
Implement a mechanism to determine the minimum number of NFTs required to cover the user's debt.
Transfer only the required number of NFTs instead of all NFTs.
Introduce a fair liquidation model to ensure users do not lose excess collateral.
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.