The _repay function allows users to repay their debt at any time, even after they have entered liquidation. If the grace period has expired but finalizeLiquidation
has not yet been executed, a user can repay their debt and potentially avoid liquidation. This creates a race condition where users can exploit the delay between the expiration of the grace period and the execution of liquidation.
The finalizeLiquidation
function reverts if called before the grace period expires.
The _repay
function does not check if the user is under liquidation or if their grace period has expired.
This allows users to repay their debt after the grace period expires but before liquidation is finalized, potentially preventing the liquidation from occurring.
Users can escape liquidation after the grace period by repaying their debt before finalizeLiquidation
is executed.
Add a check in _repay
function to prevent repayments after the grace period has expired:
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.