The getNFTPrice() function in the LendingPool contract fetches the current price of an NFT from the oracle. However, it does not check whether the retrieved price is stale. This can allow an attacker to exploit outdated prices while borrowing or repaying.
The getNFTPrice() retrieves the latest price of an NFT using priceOracle.getLatestPrice(). It also fetches the lastUpdateTimestamp, but it only reverts when the price is 0, without validating if the price is fresh.
If the oracle fails to update prices for a long time, an attacker could exploit outdated values to manipulate borrowing and repayment transactions. For example:
If the price is too high, an attacker could borrow more than they should be allowed to.
Implement a stale price check like If lastUpdateTimestamp is older than a predefined period (e.g., 1 hour), the function should revert to prevent outdated price usage.
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.