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

minhtrng - Outdated staleness check of price feed #508

Closed
sherlock-admin opened this issue Mar 28, 2023 · 0 comments
Closed

minhtrng - Outdated staleness check of price feed #508

sherlock-admin opened this issue Mar 28, 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 28, 2023

minhtrng

medium

Outdated staleness check of price feed

Summary

Checks for stale price data are outdated.

Vulnerability Detail

The function getLatestPrice checks for stale data like this:

if (answeredInRound < roundID) revert RoundIDOutdated();

According to https://ethereum.stackexchange.com/questions/133890/chainlink-latestrounddata-security-fresh-data-check-usage the variable answeredInRoundId is a legacy variable and the check for staleness should be based on the updatedAt parameter of the latedRoundData function.

Impact

outdated staleness check could cause price data to pass checks even though stale

Code Snippet

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

Tool used

Manual Review

Recommendation

Apply the check suggested in the link above.

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