Skip to content
DoS Audit finding Intermediate

[WP-H3] L1Migrator.sol#migrateETH() Improper implementation of L1Migrator causing migrateETH() always reverts, can lead to ETH in BridgeMinter getting stuck in the contract

The L1Migrator contract lacks a receive or fallback function, so when BridgeMinter tries to send it ETH, the call reverts. This means the migrateETH function always fails, and any ETH held by BridgeMinter could become stuck.

WatchPug Follow

Originally disclosed on Code4rena

Submitted by WatchPug, also found by gzeon.

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

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

L1Migrator.sol#migrateETH() will call IBridgeMinter(bridgeMinterAddr).withdrawETHToL1Migrator() to withdraw ETH from BridgeMinter.

However, the current implementation of L1Migrator is unable to receive ETH.

https://github.com/livepeer/protocol/blob/20e7ebb86cdb4fe9285bf5fea02eb603e5d48805/contracts/token/BridgeMinter.sol#L94-L94

(bool ok, ) = l1MigratorAddr.call.value(address(this).balance)("");

A contract receiving Ether must have at least one of the functions below:

  • receive() external payable
  • fallback() external payable

receive() is called if msg.data is empty, otherwise fallback() is called.

Because L1Migrator implement neither receive() or fallback(), the call at L94 will always revert.

Impact

All the ETH held by the BridgeMinter can get stuck in the contract.

Recommendation

Add receive() external payable {} in L1Migrator.

yondonfu (Livepeer) confirmed and disagreed with severity:

Severity: 2 (Med)

We’ll fix this, but noting that the funds are recoverable because the BridgeMinter can set a new L1Migrator that does have the receive() function which is why the suggested severity is 2 (Med).

yondonfu (Livepeer) resolved:

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

0xleastwood (judge) commented:

Agree with sponsor, these funds are recoverable. However, the warden has identified a DOS attack, which is a valid medium severity issue.

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

Likely, the L1Migrator contract was not designed to receive Ether, so it lacks a payable receive or fallback function, causing any Ether transfer to it to revert.

Impact

All ETH held by BridgeMinter could get stuck because migrateETH always reverts, though the sponsor notes funds are recoverable by setting a new L1Migrator.

What the attacker needed

None

The fix

The issue was fixed by adding a receive function to L1Migrator.

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 smart contract can only accept Ether if it has a special function to do so. Here, the L1Migrator contract does not have that function, so when another contract tries to send it Ether, the transfer fails. This makes a key function always fail and could lock funds.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

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.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.