Core Contracts

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

Users are subject to liquidation after pool pause and unpause

Summary

Users are subject to liquidation after pool pause and unpause due to interest compounding implementation and missing close liquidation window.

Vulnerability Details

The LendingPool is allowed to be paused and unpaused (see pause() and unpause()). The LendingPool::repay and LendingPool::repayOnBehalf will revert if the pool is paused because of the whenNotPaused modifier.

The problem is that the borrow interest compounded calculation will not factor in the duration of pausing when a user cannot repay a loan.

File: contracts/libraries/pools/ReserveLibrary.sol#L467-L474
function getNormalizedDebt(ReserveData storage reserve, ReserveRateData storage rateData) internal view returns (uint256) {
// @audit reserve.lastUpdateTimestamp will be a timestamp before paused, interests compound during pausing
uint256 timeDelta = block.timestamp - uint256(reserve.lastUpdateTimestamp);
if (timeDelta < 1) {
return reserve.totalUsage;
}
return calculateCompoundedInterest(rateData.currentUsageRate, timeDelta).rayMul(reserve.usageIndex);
}

Impact

Interests continuously compound with no repayment allowed. When unpaused, many accounts are vulnerable to liquidation.

Also, users might miss the close liquidation window. In the paused state, users cannot neither repay, nor close liquidation. If a liquidation process is initiated on a user, and the pool get paused within this time frame, the user would miss the window to repay his loan and close the liquidation, and would be liquidated.

Tools Used

Manual review.

Recommendations

Consider storing pause/unpause timestamp to allow skipping borrow interests compounding for the duration of the pause and extend the close liquidation time frame.

Updates

Lead Judging Commences

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

Unfair Liquidation As Borrow Interest Accumulates While Paused

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