Skip to content
This repository has been archived by the owner on Dec 17, 2023. It is now read-only.

Breeje - Missing checks for whether Arbitrum Sequencer is active #155

Closed
sherlock-admin opened this issue Jun 11, 2023 · 0 comments
Closed
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue Reward A payout will be made for this issue

Comments

@sherlock-admin
Copy link
Contributor

sherlock-admin commented Jun 11, 2023

Breeje

medium

Missing checks for whether Arbitrum Sequencer is active

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

The function getPriceFromChainlink do not check if the sequencer is down or not.

If a sequencer becomes unavailable, it is impossible to access read/write APIs that consumers are using and applications on the L2 network will be down for most users without interacting directly through the L1 optimistic rollup contracts. The L2 has not stopped, but it would be unfair to continue providing service on your applications when only a few users can use them.

To help your applications identify when the sequencer is unavailable, protocols should use a data feed that tracks the last known status of the sequencer at a given point in time. This helps prevent mass liquidations by providing a grace period to allow customers to react to such an event.

Chainlink recommends that users using price oracles, check whether the Arbitrum sequencer is active

https://docs.chain.link/data-feeds#l2-sequencer-uptime-feeds

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

The price recorded by latestRoundData will be inaccurate since the true price won't be reported to the chain due to the sequence being down. This could lead to users being reported an outdated price.

Code Snippet

File: PriceOracle

  function getPriceFromChainlink(address base, address quote) internal view returns (uint256) {
      (, int256 price,,,) = registry.latestRoundData(base, quote);
      require(price > 0, "invalid price");

      // Extend the decimals to 1e18.
      return uint256(price) * 10 ** (18 - uint256(registry.decimals(base, quote)));
  }

Link to Code

Tool used

Manual Review

Recommendation

Use sequencer oracle to determine whether the sequencer is offline or not, and don't allow orders to be executed while the sequencer is offline.

Duplicate of #440

@github-actions github-actions bot added Medium A valid Medium severity issue Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels Jun 19, 2023
@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label Jun 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

1 participant