Missing checks for whether Arbitrum Sequencer is active
The protocol's price oracle does not check whether the Arbitrum sequencer is active, so if the sequencer goes down, prices from Chainlink feeds may be stale. An attacker could then submit orders and, if also a keeper, obtain execution prices that do not reflect reality.
0xdeadbeef Follow with GalloDaSballo, IllIllI and 2 others
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2023-02-gmx-judging/issues/151
Found by
0xdeadbeef, GalloDaSballo, IllIllI, ShadowForce, hack3r-0m
Summary
Chainlink recommends that users using price oracles, check whether the Arbitrum Sequencer is active
Vulnerability Detail
If the sequencer goes down, the index oracles may have stale prices, since L2-submitted transactions (i.e. by the aggregating oracles) will not be processed.
Impact
Stale prices, e.g. if USDC were to de-peg while the sequencer is offline, would let people submit orders and if those people are also keepers, get execution prices that do not exist in reality.
Code Snippet
Chainlink oracles are used for some prices, but there are no sequencer oracles in use:
// File: gmx-synthetics/contracts/oracle/Oracle.sol : Oracle._setPricesFromPriceFeeds() #1
569 IPriceFeed priceFeed = getPriceFeed(dataStore, token);
570
571 (
572 /* uint80 roundID */,
573 int256 _price,
574 /* uint256 startedAt */,
575 /* uint256 timestamp */,
576 /* uint80 answeredInRound */
577 ) = priceFeed.latestRoundData();
578
579: uint256 price = SafeCast.toUint256(_price);
Tool used
Manual Review
Recommendation
Use a chainlink oracle to determine whether the sequencer is offline or not, and don't allow orders to be executed while the sequencer is offline.
Discussion
xvi10
This is a valid issue, the risk will be reduced with a keeper network instead of a separate check
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the oracle integration omitted the recommended check of the Arbitrum sequencer's health flag before using Chainlink price feeds.
Impact
Stale prices during sequencer downtime could let users, especially keepers, execute orders at prices that do not exist in reality.
What the attacker needed
Arbitrum sequencer goes offline; attacker is also a keeper
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A sequencer is a component that orders transactions on a layer-2 network like Arbitrum. If it stops working, price updates from outside sources cannot be processed, so the prices the protocol sees become old. The protocol did not check for this situation, so someone could trade using those outdated prices and potentially profit unfairly.