Skip to content
Business logic Audit finding Intermediate

[WP-H5] L1Migrator.sol#migrateETH() does not send bridgeMinter ’s ETH to L2 causing ETH get frozen in the contract

The L1Migrator contract withdraws ETH from BridgeMinter but fails to include that amount when sending a transaction to L2, so the L2 call always fails due to insufficient funds. As a result, all ETH from BridgeMinter becomes permanently frozen in the contract.

WatchPug Follow

Originally disclosed on Code4rena

Submitted by WatchPug, also found by gzeon, harleythedog, and Ruhum.

Per the arb-bridge-eth code:

all msg.value will deposited to callValueRefundAddress on L2

uint256 seqNum = inbox.createRetryableTicket{value: _l1CallValue}(
    target,
    _l2CallValue,
    maxSubmissionCost,
    from,
    from,
    maxGas,
    gasPriceBid,
    data
);

At L308-L309, ETH held by BridgeMinter is withdrawn to L1Migrator:

https://github.com/livepeer/arbitrum-lpt-bridge/blob/ebf68d11879c2798c5ec0735411b08d0bea4f287/contracts/L1/gateway/L1Migrator.sol#L308-L309

uint256 amount = IBridgeMinter(bridgeMinterAddr)
    .withdrawETHToL1Migrator();

However, when calling sendTxToL2() the parameter _l1CallValue is only the msg.value, therefore, the ETH transferred to L2 does not include any funds from bridgeMinter.

https://github.com/livepeer/arbitrum-lpt-bridge/blob/ebf68d11879c2798c5ec0735411b08d0bea4f287/contracts/L1/gateway/L1Migrator.sol#L318-L327

sendTxToL2(
    l2MigratorAddr,
    address(this), // L2 alias of this contract will receive refunds
    msg.value,
    amount,
    _maxSubmissionCost,
    _maxGas,
    _gasPriceBid,
    ""
)

As a result, due to lack of funds, call with value = amount to l2MigratorAddr will always fail on L2.

Since there is no other way to send ETH to L2, all the ETH from bridgeMinter is now frozen in the contract.

Recommendation

Change to:

sendTxToL2(
    l2MigratorAddr,
    address(this), // L2 alias of this contract will receive refunds
    msg.value + amount, // the `amount` withdrawn from BridgeMinter should be added
    amount,
    _maxSubmissionCost,
    _maxGas,
    _gasPriceBid,
    ""
)

yondonfu (Livepeer) confirmed and resolved:

Fixed in https://github.com/livepeer/arbitrum-lpt-bridge/pull/51

0xleastwood (judge) commented:

Awesome find!

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

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 contract withdraws ETH from BridgeMinter but only passes msg.value as the L1 call value when sending to L2, omitting the withdrawn amount.

Impact

All ETH from BridgeMinter becomes permanently frozen in the L1Migrator contract, as there is no other way to send it to L2.

What the attacker needed

ETH held by BridgeMinter; migrateETH() is called

The fix

The fix was to add the withdrawn amount to msg.value when calling sendTxToL2, and it was fixed in a pull request.

How it was found

  1. Call migrateETH() which withdraws ETH from BridgeMinter to L1Migrator.
  2. The contract calls sendTxToL2 with _l1CallValue equal to msg.value only.
  3. The L2 call to l2MigratorAddr with value amount fails due to insufficient funds.
  4. The ETH from BridgeMinter remains frozen in the L1Migrator contract.

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.

This is a smart contract bug where a function moves money from one contract to another but forgets to add that money to a transaction sent to another network. Because the transaction doesn't have enough funds, it fails, and the money gets stuck forever.

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 WatchPug

View all

197 more disclosed reports, best first.

More from Livepeer Onchain Treasury Upgrade

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.