No check if Arbitrum/Optimism L2 sequencer is down in Chainlink feeds PriceOracle.sol
The protocol's price oracle reads Chainlink feeds without checking whether the Arbitrum sequencer is live, so prices can be stale while the sequencer is down. Users could keep borrowing or avoid liquidation at outdated prices.
Submitted by Ch_301, also found by oakcobalt and bin2chen
Chainlink recommends that all Optimistic L2 oracles consult the Sequencer Uptime Feed to ensure that the sequencer is live before trusting the data returned by the oracle.
If the Arbitrum Sequencer goes down, oracle data will not be kept up to date, and thus could become stale. However, users are able to continue to interact with the protocol directly through the L1 optimistic rollup contract. You can review Chainlink docs on L2 Sequencer Uptime Feeds for more details on this.
This protocol uses getPriceOracle() everywhere and it sub call to PriceOracle.sol#latestRoundData(). As a result, users may be able to use the protocol while Oracle feeds are stale. This could cause many problems, for example:
- A user has a loan with 100 tokens, valued at 1 ETH each, and no borrows.
- The Arbitrum sequencer goes down temporarily.
- While it’s down, the price of the token falls to 0.5 ETH each.
- The current value of the user’s loan is 50 ETH, so the liquidators should be able to liquidate this position because it is unhealthy.
- However, due to the stale price, the protocol lets the user keep borrowing.
Impact
If the Arbitrum sequencer goes down, the protocol will allow users to continue to operate at the previous (stale) prices. This will break all the core functionality in the protocol.
Tools Used
Solodit
Recommended Mitigation Steps
It is recommended to follow the code example of Chainlink here or just add this check:
File: PriceOracle.sol
function getAssetPriceFromChainlink(address asset) public view returns (uint256) {
AggregatorV2V3Interface sourceAgg = assetChainlinkAggregators[asset];
require(address(sourceAgg) != address(0), Errors.ASSET_AGGREGATOR_NOT_EXIST);
if (!isSequencerActive()) revert Errors.L2SequencerUnavailable();
...
}
function isSequencerActive() internal view returns (bool) {
(, int256 answer, uint256 startedAt,,) = sequencer.latestRoundData();
if (block.timestamp - startedAt <= GRACE_PERIOD_TIME || answer == 1)
return false;
return true;
}
Assessed type
Oracle
thorseldon (BendDAO) acknowledged and commented:
Checking the stale interval or grace period of oracle price, it’s maybe better do this as suggested, but it’s hard to set or predict the appropriate interval time.
We suggest adjust the severity level to informative.
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 price oracle reads Chainlink feeds without consulting the L2 sequencer uptime feed or enforcing a grace period.
Impact
While the sequencer is down, users could keep borrowing and avoid liquidation at stale prices, breaking core protocol behaviour; the report does not show this being exploited.
What the attacker needed
Protocol deployed on Arbitrum; sequencer goes down
The fix
The oracle should check the Chainlink sequencer uptime feed and reject prices during downtime or a grace period, though the team noted the right interval is hard to set.
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 blockchain oracle is a service that feeds outside data, such as token prices, into a smart contract. On some layer-2 networks a central sequencer orders transactions, and if it stops, the price data stops updating while people can still use the network. This protocol never checks that the sequencer is running, so it may act on old prices.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.