Skip to content
Audit finding Intermediate

No check for active Arbitrum Sequencer in WSTETH Oracle

The WSTETH oracle contract did not check whether the Arbitrum sequencer was live before returning price data, unlike the protocol's other Arbitrum oracle. If the sequencer went down, prices could become stale and users could keep borrowing against outdated values.

obront Follow with pashov

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2022-11-sentiment-judging/issues/3

Found by

obront, pashov

Summary

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. This check is implemented in ArbiChainlinkOracle.sol, but is skipped in WSTETHOracle.sol.

Vulnerability Detail

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.

As a result, users may be able to use the protocol while oracle feeds are stale. This could cause many problems, but as a simple example:

  • A user has an account 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 account is 50 ETH, so they should be able to borrow a maximum of 200 ETH to keep account healthy ((200 + 50) / 200 = 1.2)
  • Because of the stale price, the protocol lets them borrow 400 ETH ((400 + 100) / 400 = 1.2)

Impact

If the Arbitrum sequencer goes down, the protocol will allow users to continue to operate at the previous (stale) rates.

Code Snippet

https://github.com/sherlock-audit/2022-11-sentiment/blob/main/oracle-merged/src/wsteth/WSTETHOracle.sol#L45-L57

Tool used

Manual Review

Recommendation

Add the same check to WSTETHOracle.sol that exists in ArbiChainlinkOracle.sol:

Solidity
function getPrice(address token) external view override returns (uint) {
    if (!isSequencerActive()) revert Errors.L2SequencerUnavailable();
    ...
}
Solidity
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;
}

Discussion

r0ohafza

Fix PR: https://github.com/sentimentxyz/oracle/pull/46

zobront

PR confirmed.

The original report as published on Sherlock, by obront. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

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

The WSTETH oracle omitted the sequencer uptime check that Chainlink recommends for optimistic L2 price feeds, so it trusted data that could be stale.

Impact

While the sequencer is down, the protocol could let users borrow against stale prices, potentially leaving accounts under-collateralised once prices update.

What the attacker needed

Arbitrum sequencer goes down; stale oracle price differs from market

The fix

The same sequencer uptime check used in the other Arbitrum oracle should be added to the WSTETH oracle, and a fix pull request was confirmed.

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 prices, into a smart contract. On Arbitrum, a central sequencer orders transactions, and if it stops, prices stop updating while people can still act through the slower base layer. This report says one price contract forgot to check that the sequencer was running, so it could hand out old prices.

More by obront

View all

46 more disclosed reports, best first.

More from Sentiment Update #3

View all

The newest disclosed reports for this program.

Similar reports

Same bug class and techniques, clearest first.