The interplay between LendingPool's initiateLiquidation, closeLiquidation, and finalizeLiquidation functions
is flawed. When a user health factor (HF) falls below the threshold, initiateLiquidation sets isUnderLiquidation[user] = true and records a liquidationStartTime. Users have a grace period to repay their debt & must manually call closeLiquidation to reset isUnderLiquidation to false.
However, if they repay but fail to call closeLiquidation before the grace period expires, two severe issues arise,
If the grace period ends and isUnderLiquidation[user] remains true, the owner can call finalizeLiquidation to liquidate the user. This function only checks isUnderLiquidation and the expired grace period, not the user’s current HF.
As a result, a user who repays their debt within grace period and achieves a healthy HF can still be liquidated unfairly if they fail to call the closeLiquidation. In fact, if they fail to call closeLiquidation within grace period, regardless of whether they keep a healthy factor, they can be liquidated by owner or manager.
If the owner or manager decids not to liquidate the user after the grace period by checking their health factor, the isUnderLiquidation[user] = true state persists indefinitely since only closeLiquidation can set it to false. So next time their health factor dips, the initiateLiquidation can't be called as it would revert because of isUnderLiquidation[user] = true. No one can re-initiate liquidation if the user’s HF drops below the threshold again later. The issue is the reliance on a single, time-sensitive manual action (closeLiquidation) to reset the liquidation state, combined with initiateLiquidation’s guard against re-initiation and finalizeLiquidation’s lack of an HF check.
Solvent users can still be liquidated due to oversight, eroding trust and fairness.
Manual Review
Add an HF check in finalizeLiquidation to prevent liquidation of solvent users and prevent users from repaying if they're under liquidation and grace period has ended. Also, make adjustments to the StabilityPool functions that call finalizeLiquidation to account for a return when hf is healthy.
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.