The absence of a check for round completeness could lead to stale prices and wrong price return value, or outdated prices. The functions that rely on accurate price feed might not work as expected, with sometimes a loss of funds as a result.
The function staleCheckLatestRoundData()
calls out to a Chainlink oracle with latestRoundData() to get the price of some token. Although the returned timestamp is checked, there is no check for round completeness.
According to Chainlink's documentation, this function does not give an error if no answer has been reached but returns 0 or outdated round data. The external Chainlink oracle, which provides index price information to the system, introduces risk inherent to any dependency on third-party data sources. For example, the oracle could fall behind or otherwise fail to be maintained, resulting in outdated data being fed to the index price calculations. Oracle reliance has historically resulted in crippled on-chain systems, and complications that lead to these outcomes can arise from things as simple as network congestion.
If there is a problem with the Chainlink oracle 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 data (if oracles are unable to submit no new round is started).
This could lead to stale prices and wrong price return value, or outdated prices.
As a result, the functions relying on accurate price feed might not work as expected, which sometimes can lead to fund loss, incorrect liquidation, wrong amounts of DSC minted for x collateral, etc.
Manual review
Add the check require(answeredInRound >= roundID, "round not complete");
to the staleCheckLatestRoundData
function as shown below.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.