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

ast3ros - [M-3] Chainlink’s latestRoundData Might Return Stale Results #338

Closed
sherlock-admin opened this issue Mar 27, 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

@sherlock-admin
Copy link
Contributor

sherlock-admin commented Mar 27, 2023

ast3ros

medium

[M-3] Chainlink’s latestRoundData Might Return Stale Results

Summary

The function does not verify the updatedAt timestamp that is returned by the Chainlink Oracle. This creates a vulnerability that allows the protocol to use stale data from the oracle, which may not reflect the current market conditions.

Vulnerability Detail

The returned updatedAt timestamp is not checked when calling priceFeed.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 data (if oracles are unable to submit no new round is started)

Impact

The function triggerDepeg relies on the latestRoundData API from Chainlink to determine if a depeg event has occurred. However, if the API returns a stale price that does not match the current market price, the function may fail to detect the depeg and execute the necessary actions. This can result in a loss of funds for the depositors of the premium vault, who will not be able to claim their share of the collateralTVL.

Code Snippet

https://github.com/sherlock-audit/2023-03-Y2K/blob/main/Earthquake/src/v2/Controllers/ControllerPeggedAssetV2.sol#L296-L317

Tool used

Manual Review

Recommendation

Consider checking the oracle responses updatedAt value after calling out to priceFeed.latestRoundData() verifying that the result is within an allowed margin of freshness.

Duplicate of #70

@github-actions github-actions bot closed this as completed Apr 3, 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 Apr 3, 2023
@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label Apr 11, 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