Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Age of chainlink feed response not validated #222

Closed
code423n4 opened this issue Sep 18, 2022 · 1 comment
Closed

Age of chainlink feed response not validated #222

code423n4 opened this issue Sep 18, 2022 · 1 comment
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working duplicate This issue or pull request already exists satisfactory satisfies C4 submission criteria; eligible for awards sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-09-y2k-finance/blob/bca5080635370424a9fe21fe1aded98345d1f723/src/Controller.sol#L295

Vulnerability details

Impact

Controller only checks that timeStamp is not equal to 0. However, the actual age of the response is not validated.

Proof Of Concept

When the feed returns a very old price, a depeg event can be triggered, although it did not happen during the insurance timespan. For instance, if the feed would return a response that is 1 day old for a freshly started vault, a depeg could be initiated, although the peg might have recovered and was never below the threshold in the insurance timespan.

Recommended Mitigation Steps

All responses that are older than the epoch begin of the queried epoch should be discarded, because any depeg that happened before the epoch begin is not insured.

@code423n4 code423n4 added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working labels Sep 18, 2022
code423n4 added a commit that referenced this issue Sep 18, 2022
@MiguelBits MiguelBits added duplicate This issue or pull request already exists sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons and removed duplicate This issue or pull request already exists labels Sep 30, 2022
@HickupHH3
Copy link
Collaborator

dup #61

@HickupHH3 HickupHH3 added duplicate This issue or pull request already exists satisfactory satisfies C4 submission criteria; eligible for awards labels Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working duplicate This issue or pull request already exists satisfactory satisfies C4 submission criteria; eligible for awards sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Projects
None yet
Development

No branches or pull requests

3 participants