This repository has been archived by the owner on May 26, 2023. It is now read-only.
0xNazgul - [NAZ-M2] Lack of Price Freshness Check In _latestAnswer64x64()
Allows A Stale Price To Be Used
#98
Labels
0xNazgul
medium
[NAZ-M2] Lack of Price Freshness Check In
_latestAnswer64x64()
Allows A Stale Price To Be UsedSummary
PricerInternal.sol
should use theupdatedAt
value from thelatestRoundData()
function to make sure that the latest answer is recent enough to be used.Vulnerability Detail
This could lead to stale prices being used.
If the market price of the token drops very quickly ("flash crashes"), and Chainlink's feed does not get updated in time, the smart contract will continue to believe the token is worth more than the market value.
Chainlink also advise developers to check for the
updatedAt
before using the priceImpact
A stale price can cause the malfunction of multiple features across the protocol.
Code Snippet
PricerInternal.sol#L50-L52
Tool used
Manual Review
Recommendation
Consider adding the missing freshness check for stale price.
Duplicate of #137
The text was updated successfully, but these errors were encountered: