The LendingPool
contract fails to implement staleness checks when fetching NFT prices from the oracle, potentially allowing the use of outdated price data for critical operations like borrowing, liquidations, and collateral valuations.
In getNFTPrice()
, the contract retrieves price data from the oracle but ignores the lastUpdateTimestamp
:
This function is used in critical operations:
Collateral valuation (getUserCollateralValue
)
Health factor calculations (calculateHealthFactor
)
NFT withdrawal checks (withdrawNFT
)
Liquidation decisions (initiateLiquidation
)
Overborrowing attack:
A malicious user deposited an NFT which initial price of the NFT is 100ETH
Due to market movement, price of the NFT drops to 60ETH,
Malicious user see that price has not been updated in the lendingpool
Malicious user can quickly borrow 80% of the 100ETH which is 80ETH against NFT which has dropped in market but not updated on the lendingPool.
He made extra 20ETH from the pool because he was able to take out 80ETH from the pool against a collateral of 100ETH that has dropped to 60ETH.
The vulnerability stems from:
No timestamp validation in price feeds
Missing oracle freshness checks
Incorrect collateral valuation leading to under/over-borrowing
Potential manipulation of liquidations using stale prices
System operating on outdated market data
Risk of significant financial losses
Manual code review
Add staleness check with configurable threshold:
}
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.