You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.
sherlock-admin opened this issue
Mar 27, 2023
· 0 comments
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
Lack of validation for chainlink price feed timestamp allows outdated price to be used.
Summary
Lack of validation for chainlink price feed timestamp allows outdated price to be used.
Vulnerability Detail
in the getLatestPrice function latestRoundData calls to an oracle. The problem with the function is that it does not validate that the chainlink pricefeed timestamp is up to date. You can observe this issue by looking at the snippet below.
As you can see the logic never validates that the chainlink timestamp is up to date and fresh, this in turn allows outdated prices from the chainlink price oracle to be used in the project.
Impact
the epoch can be wrongly settled, when the insurance token depegs, the code does not know it is depegged because of the outdated price oracle,
Insurance buyer (depositor in premium vault) lose their premium and does not get protection from the collateral vault as the protocol stated.
Loss of funds and the functionality of the entire protocol is at risk because of this.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
ShadowForce
medium
Lack of validation for chainlink price feed timestamp allows outdated price to be used.
Summary
Lack of validation for chainlink price feed timestamp allows outdated price to be used.
Vulnerability Detail
in the
getLatestPrice
functionlatestRoundData
calls to an oracle. The problem with the function is that it does not validate that the chainlink pricefeed timestamp is up to date. You can observe this issue by looking at the snippet below.As you can see the logic never validates that the chainlink timestamp is up to date and fresh, this in turn allows outdated prices from the chainlink price oracle to be used in the project.
Impact
the epoch can be wrongly settled, when the insurance token depegs, the code does not know it is depegged because of the outdated price oracle,
Insurance buyer (depositor in premium vault) lose their premium and does not get protection from the collateral vault as the protocol stated.
Loss of funds and the functionality of the entire protocol is at risk because of this.
Code Snippet
https://github.com/Y2K-Finance/Earthquake/blob/736b2e1e51bef6daa6a5ecd1decb7d156316d795/src/v2/Controllers/ControllerPeggedAssetV2.sol#L273-L318
Tool used
Manual Review
Recommendation
we recommend to add check to validate the timestamp of the oracle is up to date.
Duplicate of #70
The text was updated successfully, but these errors were encountered: