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

Should check return data from Chainlink aggregators #70

Open
code423n4 opened this issue May 27, 2021 · 2 comments
Open

Should check return data from Chainlink aggregators #70

code423n4 opened this issue May 27, 2021 · 2 comments

Comments

@code423n4
Copy link
Contributor

Handle

shw

Vulnerability details

Impact

The getEtherPrice function in the contract FSDNetwork fetches the ETH price from a Chainlink aggregator using the latestRoundData function. However, there are no checks on roundID nor timeStamp, resulting in stale prices.

Proof of Concept

Referenced code:
FSDNetwork.sol#L376-L381

Recommended Mitigation Steps

Add checks on the return data with proper revert messages if the price is stale or the round is uncomplete, for example:

(uint80 roundID, int256 price, , uint256 timeStamp, uint80 answeredInRound) = ETH_CHAINLINK.latestRoundData();
require(answeredInRound >= roundID, "...");
require(timeStamp != 0, "...");
@fairside-core
Copy link
Collaborator

Fixed in PR#7.

@cemozerr
Copy link
Collaborator

cemozerr commented Jun 8, 2021

Labeling this as medium risk as stale ether price could put funds at risk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants