Skip to content
This repository has been archived by the owner on Nov 26, 2023. It is now read-only.

ni8mare - Chainlink Oracle return values are not being checked. #270

Closed
sherlock-admin opened this issue May 23, 2023 · 0 comments
Closed
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue Reward A payout will be made for this issue

Comments

@sherlock-admin
Copy link
Contributor

sherlock-admin commented May 23, 2023

ni8mare

medium

Chainlink Oracle return values are not being checked.

Summary

Chainlink Oracle return values are not handled properly.

Vulnerability Detail

The chainlink priceFeed.latestRoundData() returns other values (like roundId, updatedAt, answeredInRound) apart from price that need to be checked. Otherwise, we could get 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.

Code Snippet

This is seen in the following contacts:

StableOracleDai
StableOracleWBTC
StableOracleWETH

Tool used

Manual Review

Recommendation

It is recommended to add the following checks:

require(price > 0, "Invalid price");
require(answeredInRound >= roundID , "Stale price");
require(timestamp != 0, "Round not complete");

Duplicate of #31

@github-actions github-actions bot closed this as completed Jun 5, 2023
@github-actions github-actions bot added Medium A valid Medium severity issue Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels Jun 5, 2023
@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

1 participant