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

Chainlink oracle might return stale data #133

Closed
code423n4 opened this issue Jul 7, 2022 · 1 comment
Closed

Chainlink oracle might return stale data #133

code423n4 opened this issue Jul 7, 2022 · 1 comment
Labels
3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working duplicate This issue or pull request already exists valid

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/jbx-protocol/juice-contracts-v2-code4rena/blob/828bf2f3e719873daa08081cfa0d0a6deaa5ace5/contracts/JBChainlinkV3PriceFeed.sol#L42

Vulnerability details

Impact

Oracle might return stale data for _price

Proof of Concept

currentPrice in JBChainlinkV3PriceFeed.sol.sol does not check if the data from Chainlink is fresh (https://github.com/jbx-protocol/juice-contracts-v2-code4rena/blob/828bf2f3e719873daa08081cfa0d0a6deaa5ace5/contracts/JBChainlinkV3PriceFeed.sol#L42). If there is a problem with the Chainlink oracle, this contract may be supplied with incorrect or stale data.

See these previous issues for reference:
code-423n4/2021-10-mochi-findings#87
code-423n4/2022-01-yield-findings#78

Tools Used

Manual code review

Recommended Mitigation Steps

Implement checks with require stataments using roundID and answeredInRound info supplied by Chainlink to ensure the data is fresh. See the mitigation in (code-423n4/2021-10-mochi-findings#87).

@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 Jul 7, 2022
code423n4 added a commit that referenced this issue Jul 7, 2022
@mejango
Copy link
Collaborator

mejango commented Jul 12, 2022

dup #138

@mejango mejango closed this as completed Jul 12, 2022
@mejango mejango added the duplicate This issue or pull request already exists label Jul 12, 2022
@jack-the-pug jack-the-pug added 3 (High Risk) Assets can be stolen/lost/compromised directly valid and removed 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value labels Jul 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working duplicate This issue or pull request already exists valid
Projects
None yet
Development

No branches or pull requests

3 participants