Core Contracts

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

NFT Price Staleness Attacks in LendingPool due to Block.timestamp

Summary :

The price oracle's use of block.timestamp for recording price updates allows miners to manipulate price staleness checks, enabling NFT withdrawals at manipulated timestamps that could harm protocol solvency.

Vulnerability Details :

the issue exist in :

function setHousePrice(uint256 _tokenId, uint256 _amount) external onlyOracle {
tokenToHousePrice[_tokenId] = _amount;
lastUpdateTimestamp = block.timestamp; // Vulnerable to miner manipulation
emit PriceUpdated(_tokenId, _amount);
}

so when a calling withdrawNFT function in LendingPool contract that calls the getNFTPrice

function as follow :

function withdrawNFT(uint256 tokenId) external nonReentrant whenNotPaused {
uint256 userDebt = user.scaledDebtBalance.rayMul(reserve.usageIndex);
uint256 collateralValue = getUserCollateralValue(msg.sender);
@> uint256 nftValue = getNFTPrice(tokenId); // Uses manipulatable timestamp
if (collateralValue - nftValue < userDebt.percentMul(liquidationThreshold)) {
revert WithdrawalWouldLeaveUserUnderCollateralized();
}
raacNFT.safeTransferFrom(address(this), msg.sender, tokenId);
}

any user can Get favorable timestamp for price update.

Impact :

  1. NFT price can return stale and the withdrawals are possible with manipulated timestamps this can make Protocol collateralization at risk and the Liquidation mechanisms compromised.

Tools Used :

Manuel review.

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!