You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Chainlink Aggregator is used to fetch the latest price of a token, there are no enough checks to ensure if returned price is stale.
Vulnerability Details
Currently, in OracleLib, when latestRoundData is read, there is the check if the updatedAt is is the value from block.timestamp and block.timestamp - 3 hours. In case this is not the case, the price is considered stale. This alone cannot be used to determine if the price is stale. This should also be reviewed, as some of the price feeds may not be updated for a long time, and the price may still be valid (eg in case market is not so active or there is no fluctionation in price).
Impact
The prices returned can be stale, therefore the calculations price, like getting health factor for the user, would essentially be incorrect and therefore set protocol in an incorrect state by the wrong output of health factor calculations.
Tools Used
Manual review
Recommendations
In order to properly evaluate whether the price is up-to-date, the following checks should also be performed:
Data returned by
latestRoundData
not checked enough in order to determinate if price is staleSeverity
Medium Risk
Relevant GitHub Links
sherlock-audit/2023-02-blueberry-judging#94
Summary
When Chainlink Aggregator is used to fetch the latest price of a token, there are no enough checks to ensure if returned price is stale.
Vulnerability Details
Currently, in
OracleLib
, whenlatestRoundData
is read, there is the check if theupdatedAt
is is the value fromblock.timestamp
andblock.timestamp - 3 hours
. In case this is not the case, the price is considered stale. This alone cannot be used to determine if the price is stale. This should also be reviewed, as some of the price feeds may not be updated for a long time, and the price may still be valid (eg in case market is not so active or there is no fluctionation in price).Impact
The prices returned can be stale, therefore the calculations price, like getting health factor for the user, would essentially be incorrect and therefore set protocol in an incorrect state by the wrong output of health factor calculations.
Tools Used
Manual review
Recommendations
In order to properly evaluate whether the price is up-to-date, the following checks should also be performed:
The text was updated successfully, but these errors were encountered: