Chainlink's latestRoundData might return stale or incorrect results #1
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate
This issue or pull request already exists
Lines of code
https://github.com/code-423n4/2022-02-hubble/blob/main/contracts/Oracle.sol#L33
Vulnerability details
Impact
On Oracle.sol, we are using latestRoundData, but there is no check if the return value indicates stale data.
This could lead to stale prices according to the Chainlink documentation:
https://docs.chain.link/docs/historical-price-data/#historical-rounds
https://docs.chain.link/docs/faq/#how-can-i-check-if-the-answer-to-a-round-is-being-carried-over-from-a-previous-round
Proof of Concept
https://github.com/code-423n4/2022-02-hubble/blob/main/contracts/Oracle.sol#L33
Tools Used
None
Recommended Mitigation Steps
Consider adding missing checks for stale data.
For example:
The text was updated successfully, but these errors were encountered: