Core Contracts

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

The `LendingPool::getNFTPrice()` function does not validate the timestamp of price updates, which may lead to the use of stale prices.

Summary

The LendingPool::getNFTPrice() function does not validate the timestamp of price updates, which may lead to the use of stale prices.

Vulnerability Details

The getNFTPrice() function retrieves both the latest price and its corresponding update timestamp from the price oracle. However, it does not verify whether the retrieved price is sufficiently recent. As a result, the function may return outdated prices, potentially leading to incorrect calculations or financial discrepancies.

function getNFTPrice(uint256 tokenId) public view returns (uint256) {
@> (uint256 price, uint256 lastUpdateTimestamp) = priceOracle.getLatestPrice(tokenId);
if (price == 0) revert InvalidNFTPrice();
return price;
}

Impact

Without a proper time validation mechanism, the function may return outdated NFT prices, which could lead to incorrect asset valuations, unfair liquidations, or improper risk assessments in the lending protocol.

Tools Used

Manual Review

Recommendations

Introduce a time validation check to ensure the retrieved price is recent before returning it. For example:

+ uint256 maxTimeInterval;
function getNFTPrice(uint256 tokenId) public view returns (uint256) {
(uint256 price, uint256 lastUpdateTimestamp) = priceOracle.getLatestPrice(tokenId);
+ require(block.timestamp < lastUpdateTimestamp + maxTimeInterval, "Price update is too old");
if (price == 0) revert InvalidNFTPrice();
return price;
}
Updates

Lead Judging Commences

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

Give us feedback!