The LendingPool::repay()
function lacks a check for liquidation status and grace period expiration, allowing users to repay debt even after their liquidation grace period has ended. This can result in users losing both their NFTs and the repaid amount.
In the LendingPool::_repay()
function does not verify if the user is under liquidation or if their grace period has expired. This creates a race condition where:
A user's position becomes undercollateralized and liquidation is initiated
The grace period expires
The user attempts to repay their debt through repay()
The repayment succeeds, taking their funds
However, closeLiquidation()
will revert due to expired grace period
The Stability Pool can still call finalizeLiquidation()
and seize the NFTs
Users who attempt to repay their debt after the grace period has expired will:
Lose their repaid funds as the debt is reduced
Still lose their NFTs to the Stability Pool through finalizeLiquidation()
Have no way to recover either their NFTs or repaid funds
This creates a significant financial loss for users who are trying to save their positions but are unaware that their grace period has expired.
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 check in the _repay()
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.