Core Contracts

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

Function mint does not check how long ago was the price updated

Summary

Function mint() in RAACNFT contract request tokenId price from raac_hp contract, but does not check how long ago price has been updated. And use returned price.

Vulnerability Details

If house price has not updated for a long time, function mint() use it anyway. But price could be incorrect and old.

Function does not check how long agoe price has been updated. Maybe a very long time ago. Oracle could be broken.

Its possible situation, because its only 1. Yes, project use chainlink. but only for call for custom data provider.

Even, project has used price from chainlink. the best practice is check time of last price update time.

Impact

If the orcacle has not update tokenId price for a long period, function mint will continue use old price. House at this moment could has higher price, than before. So. user have to pay smaller amount of tokens for mint nft, than it needed.

Tools Used

Manual review

Recommendations

Check price updated time

function mint(uint256 _tokenId, uint256 _amount) public override {
- uint256 price = raac_hp.tokenToHousePrice(_tokenId);
+ (uint256 price, uint lastUpdatePrice) = raac_hp.getLatestPrice(_tokenId);
+ uint period = 31536000; // 1 year, for example
+ require(block.timestamp - lastUpdatePrice <= period, "old price");
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.