This repository was archived by the owner on Sep 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
This repository was archived by the owner on Sep 24, 2023. It is now read-only.
Avci - _validateAndGetPrice() doesn't check If Arbitrum sequencer is down in Chainlink feeds #1
Copy link
Copy link
Open
Labels
Escalation ResolvedThis issue's escalations have been approved/rejectedThis issue's escalations have been approved/rejectedMediumA valid Medium severity issueA valid Medium severity issueRewardA payout will be made for this issueA payout will be made for this issueSponsor ConfirmedThe sponsor acknowledged this issue is validThe sponsor acknowledged this issue is validWill FixThe sponsor confirmed this issue will be fixedThe sponsor confirmed this issue will be fixed
Description
Avci
medium
_validateAndGetPrice() doesn't check If Arbitrum sequencer is down in Chainlink feeds
Summary
When utilizing Chainlink in L2 chains like Arbitrum, it's important to ensure that the prices provided are not falsely perceived as fresh, even when the sequencer is down. This vulnerability could potentially be exploited by malicious actors to gain an unfair advantage.
Vulnerability Detail
There is no check:
solidity function _validateAndGetPrice(AggregatorV2V3Interface feed_, uint48 updateThreshold_)
internal
view
returns (uint256)
{
// Get latest round data from feed
(uint80 roundId, int256 priceInt, , uint256 updatedAt, uint80 answeredInRound) = feed_
.latestRoundData();
// @audit check if Arbitrum L2 sequencer is down in Chainlink feeds: medium
// Validate chainlink price feed data
// 1. Answer should be greater than zero
// 2. Updated at timestamp should be within the update threshold
// 3. Answered in round ID should be the same as the round ID
if (
priceInt <= 0 ||
updatedAt < block.timestamp - uint256(updateThreshold_) ||
answeredInRound != roundId
) revert BondOracle_BadFeed(address(feed_));
return uint256(priceInt);
}
Impact
could potentially be exploited by malicious actors to gain an unfair advantage.
Code Snippet
Tool used
Manual Review
Recommendation
code example of Chainlink:
https://docs.chain.link/data-feeds/l2-sequencer-feeds#example-code
Metadata
Metadata
Assignees
Labels
Escalation ResolvedThis issue's escalations have been approved/rejectedThis issue's escalations have been approved/rejectedMediumA valid Medium severity issueA valid Medium severity issueRewardA payout will be made for this issueA payout will be made for this issueSponsor ConfirmedThe sponsor acknowledged this issue is validThe sponsor acknowledged this issue is validWill FixThe sponsor confirmed this issue will be fixedThe sponsor confirmed this issue will be fixed