This repository has been archived by the owner on Oct 1, 2023. It is now read-only.
roguereddwarf - ControllerPeggedAssetV2: outdated price may be used which can lead to wrong depeg events #70
Labels
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
Medium
A valid Medium severity issue
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
roguereddwarf
high
ControllerPeggedAssetV2: outdated price may be used which can lead to wrong depeg events
Summary
The
updatedAt
timestamp in the price feed response is not checked. So outdated prices may be used.Vulnerability Detail
The following checks are performed for the chainlink price feed:
https://github.com/sherlock-audit/2023-03-Y2K/blob/main/Earthquake/src/v2/Controllers/ControllerPeggedAssetV2.sol#L299-L315
As you can see the
updatedAt
timestamp is not checked.So the price may be outdated.
Impact
The price that is used by the Controller can be outdated. This means that a depeg event may be caused due to an outdated price which is incorrect. Only current prices must be used to check for a depeg event.
Code Snippet
https://github.com/sherlock-audit/2023-03-Y2K/blob/main/Earthquake/src/v2/Controllers/ControllerPeggedAssetV2.sol#L273-L318
Tool used
Manual Review
Recommendation
Introduce a reasonable limit for how old the price can be and revert if the price is older:
The text was updated successfully, but these errors were encountered: