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

Usage of deprecated ChainLink API in Buoy3Pool #106

Open
code423n4 opened this issue Jul 7, 2021 · 0 comments
Open

Usage of deprecated ChainLink API in Buoy3Pool #106

code423n4 opened this issue Jul 7, 2021 · 0 comments
Labels

Comments

@code423n4
Copy link
Contributor

Handle

cmichel

Vulnerability details

Vulnerability Details

The Chainlink API (latestAnswer) used in the Buoy3Pool oracle wrappers is deprecated:

This API is deprecated. Please see API Reference for the latest Price Feed API. Chainlink Docs

Impact

It seems like the old API can return stale data. Checks similar to that of the new API using latestTimestamp and latestRoundare are needed.
This could lead to stale prices according to the Chainlink documentation:

Recommended Mitigation Steps

Add the recommended checks:

(
    uint80 roundID,
    int256 price,
    ,
    uint256 timeStamp,
    uint80 answeredInRound
) = chainlink.latestRoundData();
require(
    timeStamp != 0,
    “ChainlinkOracle::getLatestAnswer: round is not complete”
);
require(
    answeredInRound >= roundID,
    “ChainlinkOracle::getLatestAnswer: stale data”
);
require(price != 0, "Chainlink Malfunction”);
@code423n4 code423n4 added 2 (Med Risk) bug Something isn't working labels Jul 7, 2021
code423n4 added a commit that referenced this issue Jul 7, 2021
@kitty-the-kat kitty-the-kat added the duplicate This issue or pull request already exists label Jul 14, 2021
@flabble-gro flabble-gro removed the duplicate This issue or pull request already exists label Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants