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

Chinmay - Chainlink API may return stale prices #253

Closed
github-actions bot opened this issue Mar 1, 2023 · 0 comments
Closed

Chinmay - Chainlink API may return stale prices #253

github-actions bot opened this issue Mar 1, 2023 · 0 comments
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

@github-actions
Copy link

github-actions bot commented Mar 1, 2023

Chinmay

medium

Chainlink API may return stale prices

Summary

When using the latestroundData function to fetch prices from a chainlink price feed/feed registry, it is important to make sure that it returns correct and fresh prices. The answer that is returned may be carried over from the previous round

Vulnerability Detail

There are insufficient checks to deal with stale prices from Chainlink. There should be a require(answeredInround >= roundID) statement for tracking which round data is being used, and fallback to alternate oracles by the guardian if this check reverts.

Impact

Stale prices in a volatile market can be detrimental to the protocol's execution. All functions like borrow and liquidate depend on the getPrice functionality. If the returned price becomes outdated, there maybe a loss of funds to users until guardian changes the oracle address.

Code Snippet

https://github.com/sherlock-audit/2023-02-blueberry/blob/main/contracts/oracle/ChainlinkAdapterOracle.sol#L76

Tool used

Manual Review

Recommendation

Add require(answeredInRound >= roundID) as an additional check

Duplicate of #94

@github-actions github-actions bot added Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue labels Mar 1, 2023
@github-actions github-actions bot closed this as completed Mar 1, 2023
@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label Mar 19, 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