Chainlink’s latestRoundData might return stale or incorrect results
Summary
In Oracle.solgetUnderlyingPrice() function you are using latestRoundData function, but there is no check if the return value indicates stale data.
Vulnerability Detail
The Oracle.sol calls out to a Chainlink oracle receiving the latestRoundData(). If there is a problem with Chainlink starting a new round and finding consensus on the new value for the oracle (e.g. Chainlink nodes abandon the oracle, chain congestion, vulnerability/attacks on the chainlink system) consumers of this contract may continue using outdated stale or incorrect data (if oracles are unable to submit no new round is started).
0xvj
medium
Chainlink’s latestRoundData might return stale or incorrect results
Summary
In
Oracle.sol
getUnderlyingPrice()
function you are usinglatestRoundData
function, but there is no check if the return value indicates stale data.Vulnerability Detail
The
Oracle.sol
calls out to a Chainlink oracle receiving the latestRoundData(). If there is a problem with Chainlink starting a new round and finding consensus on the new value for the oracle (e.g. Chainlink nodes abandon the oracle, chain congestion, vulnerability/attacks on the chainlink system) consumers of this contract may continue using outdated stale or incorrect data (if oracles are unable to submit no new round is started).Impact
This could lead to stale prices according to the Chainlink documentation: https://docs.chain.link/data-feeds/price-feeds/historical-data
Code Snippet
https://github.com/hubble-exchange/hubble-protocol/blob/d89714101dd3494b132a3e3f9fed9aca4e19aef6/contracts/Oracle.sol#L24C1-L36C6
Tool used
Manual Review
Recommendation
Duplicate of #18