The LendingPool contract’s repay
function is restricted by the whenNotPaused
modifier, preventing borrowers from repaying when the protocol is paused. However, the finalizeLiquidation
function, which executes forced liquidations after the grace period, does not have this restriction. This creates a scenario where a borrower who intends to repay within their grace period is unable to do so if the protocol is paused, while liquidation can still proceed. As a result, borrowers may be unfairly liquidated despite their intention to repay.
Repay Function is Restricted by whenNotPaused
This function prevents repayments when the protocol is paused.
Finalization of Liquidation is NOT Restricted by whenNotPaused
This function remains callable even when the protocol is paused, allowing liquidations to continue while repayments are blocked.
Suppose a borrower is liquidated and given a 7-day grace period to repay.
On day 5, the protocol is paused, preventing new liquidations and blocking repayments.
On day 6, the borrower attempts to repay, but fails due to whenNotPaused
.
On day 7, the grace period expires, and since finalizeLiquidation
is not restricted by whenNotPaused
, the borrower is forcefully liquidated.
Outcome: The borrower gets unfairly liquidated even though they intended to repay within the grace period.
Unfair Liquidations: Borrowers are forced into liquidation due to a protocol pause, even if they had the funds to repay.
Financial Losses: Borrowers lose their collateral despite intending to fulfill their obligations.
Allow Repayments Even When Paused
Remove whenNotPaused
from the repay
function, or add an exception allowing borrowers under liquidation to repay.
Fix:
Pause Liquidations Along with Repayments
Add whenNotPaused
to finalizeLiquidation
, ensuring that liquidations don’t proceed if repayments are blocked.
Fix:
Extend Grace Period During Pauses
If the protocol is paused, extend the borrower’s grace period until the system is unpaused.
Fix:
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.