Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: medium
Valid

User not able to stop liquidations when the contract is paused

Summary

https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/pools/LendingPool/LendingPool.sol#L496
https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/pools/LendingPool/LendingPool.sol#L375
Currently key functions like repay and closeLiquidation have a `whenNotPaused` modifier while the finalise liquidate does not have the modifier, this means that the finaliseLiquidate could be called when user has no way to save themselves from liquidations when the contract is paused
```javascript
function repay(uint256 amount) external nonReentrant whenNotPaused onlyValidAmount(amount) {
_repay(amount, msg.sender);
}
function repayOnBehalf(uint256 amount, address onBehalfOf) external nonReentrant whenNotPaused onlyValidAmount(amount) {
if (!canPaybackDebt) revert PaybackDebtDisabled();
if (onBehalfOf == address(0)) revert AddressCannotBeZero();
_repay(amount, onBehalfOf);
}
function closeLiquidation() external nonReentrant whenNotPaused {} // logic omitted for simplicity
```
finaliseLiquidate below
```javascript
function finalizeLiquidation(address userAddress) external nonReentrant onlyStabilityPool {} // logic omitted for simplicity
```
# POC
* A user's loan reaches a liquidation threshold, but they cannot repay their debt due to the pause.
* The finalizeLiquidation function remains callable, allowing liquidations to proceed.
* The user’s collateral is liquidated

Impact

User will be liquidated when contract is paused

Tools Used

manual review

Recommendation

remove the `whenNotPaused` in the functions or also add a `whenNotPaused` in the `finaliseLiquidate`
Updates

Lead Judging Commences

inallhonesty Lead Judge 3 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Unfair Liquidation As Repayment / closeLiquidation Paused While Liquidations Enabled

inallhonesty Lead Judge 3 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Unfair Liquidation As Repayment / closeLiquidation Paused While Liquidations Enabled

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.