Core Contracts

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

Incorrect Revert Message in `LendingPool

Summary

The initiateLiquidation function contains a misleading revert message. The condition if (healthFactor >= healthFactorLiquidationThreshold) reverts with HealthFactorTooLow() when the Health Factor is above or equal to the liquidation threshold. This message is incorrect because it implies the Health Factor is too low, while in reality, the Health Factor is too high for liquidation to proceed.

Vulnerability Details

The issue lies in the initiateLiquidation function in LendingPool.sol contract below:

function initiateLiquidation(address userAddress) external nonReentrant whenNotPaused {
if (isUnderLiquidation[userAddress]) revert UserAlreadyUnderLiquidation();
// update state
ReserveLibrary.updateReserveState(reserve, rateData);
UserData storage user = userData[userAddress];
uint256 healthFactor = calculateHealthFactor(userAddress);
if (healthFactor >= healthFactorLiquidationThreshold) revert HealthFactorTooLow();
isUnderLiquidation[userAddress] = true;
liquidationStartTime[userAddress] = block.timestamp;
emit LiquidationInitiated(msg.sender, userAddress);
}

The error occured in the line below

if (healthFactor >= healthFactorLiquidationThreshold) revert HealthFactorTooLow();

The revert message HealthFactorTooLow is misleading, as it suggests that the health factor is too low when the condition checks if it is too high.

Impact

The error message HealthFactorTooLow is also misleading, as it suggests that the health factor is too low when, in fact, the condition checks if it is too high.

Tools Used

Manual code review

Recommendations

Update the health factor check to correctly revert when the health factor is above the liquidation threshold:

if (healthFactor >= healthFactorLiquidationThreshold) revert HealthFactorTooHigh();
Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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

Give us feedback!