A critical vulnerability exists in the getNFTPrice function (Lines 484-489) of the LendingPool contract. The function fails to validate the freshness of price data from the IRAACHousePrices oracle, enabling attackers to exploit stale NFT valuations. This allows overborrowing against inflated collateral and delays liquidations until price updates, directly threatening protocol solvency.
The getNFTPrice function retrieves NFT prices from an external oracle but does not verify if the returned lastUpdateTimestamp is recent:
This creates two attack vectors:
Overborrowing During Oracle Downtime
If the oracle stops updating (e.g., due to technical failure), users can borrow against stale high prices, creating undercollateralized positions.
Liquidation Avoidance
Borrowers can maintain unhealthy positions indefinitely if the oracle halts updates, preventing liquidators from triggering repayments.
Protocol Insolvency
Stale prices enable users to borrow more than their collateral’s real value. When prices correct, the protocol is left with unrecoverable debt.
Delayed Liquidations
Undercollateralized positions avoid liquidation until the oracle resumes updates, increasing systemic risk.
Oracle Manipulation
Attackers could intentionally freeze oracle updates during market volatility to exploit price discrepancies.
Hardhat: Simulated oracle downtime and validated borrowing/liquidation logic.
Manual Code Review: Identified missing timestamp checks in getNFTPrice.
Slither: Detected unvalidated external calls to IRAACHousePrices.
Malicious Oracle Contract
Deploys an oracle that reports stale NFT prices:
Exploit Test
Demonstrates borrowing against stale data and subsequent insolvency:
Add time-based validation to reject stale prices in getNFTPrice:
Decentralized Oracle Fallback:
Integrate a secondary oracle (e.g., Chainlink) to cross-validate prices.
Circuit Breakers:
Pause borrowing if oracle data is stale beyond a threshold.
This vulnerability allows attackers to manipulate collateral valuations by exploiting stale oracle data, directly jeopardizing protocol solvency. Implementing timestamp validation and decentralized price feeds is critical to prevent systemic collapse.
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.