Chainlink Oracle return values are not handled properly.
Vulnerability Detail
The Chainlink function registry.latestRoundData(base, quote) returns other values like roundId, updatedAt, answeredInRound which need to be validated in order to avoid getting stale prices or incomplete rounds
Impact
If there is a problem with Chainlink starting a new round and finding consensus on the new value for the oracle, consumers of the oracle contract may continue using outdated data.
ni8mare
medium
Oracle return values are not being checked.
Summary
Chainlink Oracle return values are not handled properly.
Vulnerability Detail
The Chainlink function
registry.latestRoundData(base, quote)
returns other values likeroundId
,updatedAt
,answeredInRound
which need to be validated in order to avoid getting stale prices or incomplete roundsImpact
If there is a problem with Chainlink starting a new round and finding consensus on the new value for the oracle, consumers of the oracle contract may continue using outdated data.
Code Snippet
This is seen in the
PriceOracle
contract, in the functiongetPriceFromChainlink
Only the price is validated. Other values are not.
Tool used
Manual Review
Recommendation
It is recommended to add the following checks:
Duplicate of #9