The function checks if price == 0 but ignores lastUpdateTimestamp. If the oracle hasn’t updated the price recently (e.g., due to a malfunction), the contract uses stale data.
The contract uses getNFTPrice(tokenId) to retrieve an NFT's value
The function checks if price == 0 but ignores lastUpdateTimestamp. If the oracle hasn’t updated the price recently (e.g., due to a malfunction), the contract uses stale data.
When a user withdraws an NFT, the contract checks if their remaining collateral is sufficient:
If nftValue is stale (overvalued), collateralValue - nftValue becomes artificially low. This allows withdrawals that should be blocked, leaving the user undercollateralized with current prices. The contract does not validate if the oracle’s lastUpdateTimestamp is recent enough. Stale prices can be used for critical collateral checks.
Example:
User deposits an NFT with a stale price of 100 ETH (actual market value: 50 ETH).
They borrow 80 ETH (assuming liquidationThreshold = 80% → 80 ETH * 80% = 64 ETH collateral required).
User tries to withdraw the NFT.
getNFTPrice returns 100 ETH (stale).
If the oracle updates the price to 50 ETH after getNFTPrice is called but before the NFT is transferred:
Post-withdrawal, the user’s actual collateral is 0 ETH, but their debt remains 80 ETH.
The protocol is left with an undercollateralized loan.
The contract does not validate if the oracle’s lastUpdateTimestamp is recent enough. Stale prices can be used for critical collateral checks
Foundry
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.