Core Contracts

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

Pausing Contract Prevents Users from Avoiding Liquidation

Summary

The LendingPool contract's pause mechanism can unfairly prevent users from repaying debt or closing liquidation during grace periods, leading to forced liquidations even when users have the means and intention to resolve their positions.

Vulnerability Details

The repay(), repayOnBehalf and closeLiquidation() functions both use the whenNotPaused modifier:

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 {
address userAddress = msg.sender;
if (!isUnderLiquidation[userAddress]) revert NotUnderLiquidation();
...
}

Attack scenario:

  1. User's position becomes eligible for liquidation

  2. Liquidation is initiated, starting 3-day grace period

  3. Contract gets paused during grace period

  4. Grace period expires while contract is paused

  5. Contract gets unpaused

  6. User can no longer repay or close liquidation due to expired grace period

  7. User's collateral gets liquidated despite having funds to repay

Impact

Users lose their collateral unfairly due to protocol pause

Tools Used

Manual review

Recommendations

Remove the whenNotPaused modifier from repay(), repayOnBehalf() and closeLiquidation() functions to ensure users can always resolve their positions.

Updates

Lead Judging Commences

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

Unfair Liquidation As Repayment / closeLiquidation Paused While Liquidations Enabled

inallhonesty Lead Judge 4 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.