The current protocol design limits users’ ability to withdraw their collateral (NFTs) if they are under liquidation. If an external issue (e.g., website issue, network issue, protocol pause) prevents users from repaying debt within the liquidationGracePeriod, users cannot close their liquidation. Additionally, even after a debt is repaid beyond the grace period, users cannot withdraw their NFT collateral because the liquidation status is still active. This leaves the user in a state where their collateral is locked.
This issue arises from the interaction between the functions that handle liquidation (closeLiquidation) and NFT withdrawal (withdrawNFT) when the protocol is paused or a network issue delays repayment past the grace period.
Example Scenario:
1- Bob's account is flagged as isUnderLiquidation = true, and liquidationStartTime[userAddress] is set. He plans to repay before liquidationStartTime[userAddress] + liquidationGracePeriod expires.
2- A website issue, network issue or protocol pause delays his repayment. Bob repays the debt after the service is up, since the grace period has expired, Bob cannot call closeLiquidation(), meaning his liquidation status does not reset.
3 - The manager or owner tries to liquidateBorrower. LiquidateBorrower() requires userDebt > 0 to proceed, but Bob has already repaid his debt, so userDebt == 0 (assuming no bug to cause dust), causing the function to revert. Because liquidateBorrower() never reaches lendingPool.finalizeLiquidation(userAddress);, Bob’s liquidation status remains stuck (isUnderLiquidation = true).
4 - Bob is not able to withdraw NFT even if he repays all the debt, since his isUnderLiquidation[msg.sender] is still true
https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/pools/LendingPool/LendingPool.sol#L289
User Funds Are Stuck: Bob has no way to reclaim his NFT after full repayment.
No Administrative Workaround: Even the owner/manager cannot manually reset liquidation status in this scenario.
Manual code review
Admin workaround ensures manual recovery in extreme cases.
Reopening closeLiquidation() allows automatic recovery for users repaying late after accidents.
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.