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

ConnextPriceOracle doesn't validate Chainlink data #102

Closed
code423n4 opened this issue Jun 15, 2022 · 3 comments
Closed

ConnextPriceOracle doesn't validate Chainlink data #102

code423n4 opened this issue Jun 15, 2022 · 3 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-06-connext/blob/main/contracts/contracts/core/connext/helpers/ConnextPriceOracle.sol#L125

Vulnerability details

Impact

Consumers of a Chainlink price feed should always verify that the price they receive is fresh, i.e. submitted recently. Otherwise, your protocol might work with outdated price data resulting in arbitrage opportunities for attackers.

In the recent incident with Luna/UST, we've seen a protocol that doesn't verify the Chainlink data resulting in them losing ~$11M: https://medium.com/@blizzfinance/blizz-finance-post-mortem-2425a33fe28b

Proof of Concept

The contract only retrieves the price and ignores all the other values:

(, int256 price, , , ) = oracle.latestRoundData();

Tools Used

none

Recommended Mitigation Steps

Verify that the data is fresh by checking the updatedAt parameter: https://docs.chain.link/docs/price-feeds-api-reference/#latestrounddata

Also, Chainlink recommends consumers to be able to pause usage of a specific feed in case the feed is paused: https://docs.chain.link/docs/selecting-data-feeds/#risk-mitigation

@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 Jun 15, 2022
code423n4 added a commit that referenced this issue Jun 15, 2022
@ecmendenhall
Copy link

Duplicate of #190

@jakekidd jakekidd added the duplicate This issue or pull request already exists label Jun 24, 2022
@jakekidd
Copy link
Collaborator

dup #190

@0xleastwood
Copy link
Collaborator

Merging with #106.

@0xleastwood 0xleastwood added QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax and removed 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value labels Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Projects
None yet
Development

No branches or pull requests

4 participants