The LendingPool contract relies on the getNFTPrice() function to retrieve NFT prices for various operations such as borrowing, liquidation, and collateral calculations. However, the current implementation does not check for the staleness of the price, which could lead to the usage of outdated or incorrect prices during key actions.
Core issue: Missing price staleness check
Affected Function: getNFTPrice() used in the LendingPool contract for operations such as borrowing, liquidation, and collateral ratio calculation.
Issue: The function retrieves NFT prices without verifying whether the price is recent. If the price oracle is outdated, operations that rely on the price, such as borrowing or liquidating assets, could be affected.
contracts/core/pools/LendingPool/LendingPool.sol:getNFTPrice#L592
Inaccurate Borrowing Decisions: Using outdated prices could lead to incorrect lending or borrowing decisions, exposing the system to financial risks.
Increased Risk of Liquidation Errors: Stale prices may cause incorrect liquidation decisions, possibly allowing under-collateralized loans to remain active or incorrectly triggering liquidations.
Arbitrage Vulnerabilities: Attackers could exploit stale prices for arbitrage opportunities, profiting from price discrepancies.
Manual code review
To mitigate the risks associated with stale prices, it is recommended to add a price staleness check within the getNFTPrice() function. If the price is older than this period(for example: PRICE_EXPIRY_PERIOD), the function will revert with a error( for example: StalePriceError), ensuring that only fresh prices are used in critical operations.
The following changes should be implemented:
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.