Core Contracts

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

Unfair Liquidation As Borrower Interest Accumulates While Paused

Vulnerability Details

The LendingPool.sol uses the Pausable modifier on most functions, including core functions like borrow and repay, but interest continues to accrue through the usage index even when the contract is paused.

This creates an unfair situation where borrowers are unable to repay their loans during the paused period, yet their debt keeps increasing due to interest accumulation. The updateState function, which manages interest accrual, is not linked to the pause state, and the usageIndex keeps getting updated. As a result, a borrower who was in a good position before the pause might end up facing liquidation when the contract resumes, despite having no control over the situation and no way to avoid it.

In LendingPool.sol, the borrower functions like borrow, repay, and withdraw use the whenNotPaused modifier:

function borrow(uint256 amount) external nonReentrant whenNotPaused onlyValidAmount(amount) {
if (isUnderLiquidation[msg.sender]) revert CannotBorrowUnderLiquidation();
// ... rest of borrow logic
}
function repay(uint256 amount) external nonReentrant whenNotPaused onlyValidAmount(amount) {
_repay(amount, msg.sender);
}

However, the critical state updates and interest calculations happen in updateState does not have a pause check

function updateState() external {
ReserveLibrary.updateReserveState(reserve, rateData);
}

The debt is calculated using the usageIndex which continues to compound regardless of the contract's pause state. During a pause:

  1. The borrower cannot call repay due to the whenNotPaused modifier

  2. The usageIndex keeps increasing through updateState calls

  3. Their debt continues to grow through the rayMul calculation with the increasing usageIndex

Impact

  1. Healthy borrower can be forced into liquidity during the paused period

Tools Used

Manual review

Recommendations

  1. Implement a tiered pause system that enables independent pausing of interest functionalities.

  2. In the unpause function, you can use the pausedTimestamp to modify the interest accumulation. For instance, you could update or offset reserve.lastUpdateTimestamp to ensure that the period when the protocol was paused doesn't add to the interest that accrues.

Updates

Lead Judging Commences

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

Unfair Liquidation As Borrow Interest Accumulates While Paused

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

Unfair Liquidation As Borrow Interest Accumulates While Paused

Support

FAQs

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