Core Contracts

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

No check for staleness in values of RAACHouse Price NFTs

Summary

During borrowing and lending, valuation is used for determining things ranging from collateralValue to Liquidation Thresholds, hence the values of assets must be as up-to-date as possible, however this is not the case in the LendingPoolContract, where RAAC NFT House prices are obtained and used whether they are stale or not.

Vulnerability Details

In the getUserCollateralValue(), the value of the NFTs owned by a user is obtained and looped through, and getNFTPrice() is called for each tokenId, and this leads us to the function, where the lastUpdateTimestampis neither verified nor used at all.

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

Impact

Stale values allow user to exploit the system for financial gains through some form of arbitrage, the RAAC values are crucial to the calculation of liquidation/collateral values so they must be up to date.

Tools Used

Manual Review

Recommendations

When dealing with ChainlinkOracles the difference between the lastUpdateTimestamp and block.timestamp is usually checked against some threshold, that would be fine here.

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.