Core Contracts

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

H-01: No check of stale data from the oracle in the LendingPool

Summary

The getNFTPricemethod in the LendingPool.sol contract returns the price of the parameter NFT. However, it was identified that the function does not check whether the received data is valid or out of date.

Vulnerability Details

/**
* @notice Gets the current price of an NFT from the oracle
* @param tokenId The token ID of the NFT
* @return The price of the NFT
*/
function getNFTPrice(uint256 tokenId) public view returns (uint256) {
(uint256 price, uint256 lastUpdateTimestamp) = priceOracle
.getLatestPrice(tokenId);
if (price == 0) revert InvalidNFTPrice();
return price;
}

The LendingPool.sol::getNFTPricereturns the price for an NFT ID which is later used in functions LendingPool.sol::withdrawNFTand LendingPool.sol::getUserCollateralValue. Staleness in the data can cause the following issues

  • During the withdrawal process, the contract might allow a user to withdraw their NFT even when it would leave them undercollateralized. This would break the collateralization guarantees of the system and expose lenders to losses.

  • Stale prices could lead to inconsistencies in user collateral tracking, affecting both liquidations and debt calculations and leading to potential bad lending due to incorrect price

Impact

  • Undercollateralized Withdrawals – Users may withdraw NFTs even when it leaves them undercollateralized, breaking the system’s collateralization guarantees and exposing lenders to losses.

  • Inaccurate Liquidations & Debt Calculations – Incorrect price data can lead to improper liquidation decisions, bad debt accumulation, and inaccurate lending risk assessments.

Tools Used

Manual Review

Recommendations

It is recommended to reject prices older than the threshold corresponding to the heartbeat of the price feed. The staleness threshold should correspond to the heartbeats of the oracle’s price feed.

Updates

Lead Judging Commences

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

LendingPool::getNFTPrice or getPrimeRate doesn't validate timestamp staleness despite claiming to, allowing users to exploit outdated collateral values during price drops

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

LendingPool::getNFTPrice or getPrimeRate doesn't validate timestamp staleness despite claiming to, allowing users to exploit outdated collateral values during price drops

Support

FAQs

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