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 price data could be stale #49

Closed
code423n4 opened this issue May 26, 2021 · 2 comments
Closed

ChainLink price data could be stale #49

code423n4 opened this issue May 26, 2021 · 2 comments
Labels
2 (Med Risk) bug Something isn't working disagree with severity duplicate This issue or pull request already exists

Comments

@code423n4
Copy link
Contributor

Handle

cmichel

Vulnerability details

Vulnerability Details

There is no check in FSDNetwork.getEtherPrice if the return values indicate stale data. This could lead to stale prices according to the Chainlink documentation:

Impact

Stale prices that do not reflect the current market price anymore could be used which would influence the membership and cost share pricing.

Recommendation

Add the recommended checks:

(
    uint80 roundID,
    int256 price,
    ,
    uint256 timeStamp,
    uint80 answeredInRound
) = ETH_CHAINLINK.latestRoundData();
require(
    timeStamp != 0,
    "ChainlinkOracle::getLatestAnswer: round is not complete"
);
require(
    answeredInRound >= roundID,
    "ChainlinkOracle::getLatestAnswer: stale data"
);
require(price != 0, "FSDNetwork::getEtherPrice: Chainlink Malfunction");
@code423n4 code423n4 added 2 (Med Risk) bug Something isn't working labels May 26, 2021
code423n4 added a commit that referenced this issue May 26, 2021
@fairside-core
Copy link
Collaborator

fairside-core commented May 30, 2021

I believe it should be reduced in severity. The second bullet point only applies to historical rounds, not the latest round meaning that invalidity will never occur. Staleness will occur, however, the attack vector has a low likelihood given Chainlink's reputation. Still, definitely a 1 (minor) issue!

@fairside-core
Copy link
Collaborator

Duplicate of #70

@fairside-core fairside-core marked this as a duplicate of #70 May 30, 2021
@fairside-core fairside-core added disagree with severity duplicate This issue or pull request already exists labels May 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 (Med Risk) bug Something isn't working disagree with severity duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants