Core Contracts

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

Lack of check for NFT price lastUpdateTimestamp, it might cause calculation for collateral have a wrong result because of stale price

Summary

Lack of check for NFT price lastUpdateTimestamp, it might cause calculation for collateral have a wrong result because of stale price

Vulnerability Details

Collateral value of the user is determined from the price of RAACNFT.sol. This value is obtained by calling the function getUserCollateralValue() -> getNFTPrice().

function getNFTPrice(uint256 tokenId) public view returns (uint256) {
(uint256 price, uint256 lastUpdateTimestamp) = priceOracle.getLatestPrice(tokenId); //@audit-issue there is no check if the price stale, based on sponsor nft price will be update for 2 - 3 / year
if (price == 0) revert InvalidNFTPrice();
return price;
}

Problem arise when reading the NFT price data, the main problem is that there is no check whether the price is the most updated price or a stale price because based on information from the protocol team, the NFT price will be updated at least 2-3 times a year.

In this way, the use of stale price can cause miscalculation for collateral value for user and can be detrimental to them (in worst case leading to the user being liquidated).

Impact

Miscalculation for collateral value for user

Tools Used

Manual Review

Recommended Mitigation

Consider add check for lastUpdateTimestamp

Updates

Lead Judging Commences

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