Skip to content
Business logic Audit finding Intermediate

No check if Arbitrum L2 sequencer is down in Chainlink feeds

The GLP oracle on Arbitrum reads a Chainlink price feed without checking whether the L2 sequencer is down, so a stale price can still look fresh. A malicious actor could exploit sequencer downtime to borrow against an inflated price or dodge liquidation at a deflated one.

0xdeadbeef Follow

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2023-01-sentiment-judging/issues/16

Found by

0xdeadbeef

Summary

Using Chainlink in L2 chains such as Arbitrum requires to check if the sequencer is down to avoid prices from looking like they are fresh although they are not.

The bug could be leveraged by malicious actors to take advantage of the sequencer downtime.

Vulnerability Detail

The new GLPOracle is used the get the the price of GLP. There is no check that the sequencer is down: https://github.com/sherlock-audit/2023-01-sentiment/blob/main/oracle/src/gmx/GLPOracle.sol#L47

Solidity
    function getEthPrice() internal view returns (uint) {
        (, int answer,, uint updatedAt,) =
            ethUsdPriceFeed.latestRoundData();

        if (block.timestamp - updatedAt >= 86400)
            revert Errors.StalePrice(address(0), address(ethUsdPriceFeed));

        if (answer <= 0)
            revert Errors.NegativePrice(address(0), address(ethUsdPriceFeed));

        return uint(answer);
    }

Impact

The impact depends on the usage of the GLP. If it is used as part of the collateral for lenders:

  • Users can get better borrows if the price is above the actual price
  • Users can avoid liquidations if the price is under the actual price

Code Snippet

Tool used

VS Code

Manual Review

Recommendation

It is recommended to follow the code example of Chainlink: https://docs.chain.link/data-feeds/l2-sequencer-feeds#example-code

Discussion

zobront

Fix confirmed.

The original report as published on Sherlock, by 0xdeadbeef. 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

Likely the oracle's staleness check relies only on the feed's timestamp and omits the Chainlink L2 sequencer uptime feed, so prices frozen during sequencer downtime are treated as fresh.

Impact

If GLP is used as collateral, users could obtain larger borrows when the stale price is above the real one or avoid liquidation when it is below, though this depends on how GLP is used.

What the attacker needed

GLP used as collateral; Arbitrum sequencer goes down

The fix

The oracle should follow Chainlink's documented example and check the L2 sequencer uptime feed before accepting a price; the discussion states a fix 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.

On a layer-2 network like Arbitrum, a central sequencer orders transactions, and if it goes offline prices stop updating. The oracle only checks how old the last price is, so a price frozen during an outage can still pass as current. Someone could then borrow or avoid liquidation using a price that no longer matches the market.

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.

More by 0xdeadbeef

View all

9 more disclosed reports, best first.

More from Sentiment Update #3

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.