LendingPool.sol
contains a critical vulnerability related to stale price data usage in its collateral valuation system. It fails to validate the freshness of price data from the oracle, allowing users to exploit outdated prices to create bad debt positions. This vulnerability is particularly dangerous because:
Users can borrow against collateral values that no longer reflect market reality
The system accepts NFT deposits and calculates borrowing power using potentially outdated price data
When prices are finally updated, positions can become severely underwater
The liquidation mechanism becomes ineffective because the collateral value is less than the borrowed amount
This creates unrecoverable bad debt in the protocol
Imagine getting a loan on your house using its value from 5 years ago, even though the current market price has dropped significantly. The bank would be giving you more money than your house is actually worth, creating a risky situation where you owe more than your collateral is worth.
Price Oracle Implementation:
Deposit and Borrow Flow:
Proof of code:
The test demonstrates the exploit path:
Initial Setup:
Exploit Execution:
Result:
Collateral value: 50 ETH
Borrowed amount: 70 ETH
Position is underwater by 20 ETH
Cannot be liquidated effectively due to insufficient collateral value
Financial Impact:
Protocol suffers unrecoverable bad debt
Liquidity providers lose funds
System becomes undercollateralized
Protocol Solvency:
Accumulation of bad debt
Inability to maintain proper collateralization ratios
Risk of protocol bankruptcy
Implement Price Freshness Check:
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.