Skip to content
Access control Audit finding Intermediate

[WP-M1] BURNER_ROLE can burn any amount of L2LivepeerToken from an arbitrary address

The L2LivepeerToken contract allowed any address with the BURNER_ROLE to burn tokens from any other address. A malicious or compromised holder of that role could burn the balance of a Uniswap pool and effectively steal almost all the funds from the liquidity pool.

WatchPug Follow

Originally disclosed on Code4rena

Submitted by WatchPug, also found by cccz.

https://github.com/livepeer/arbitrum-lpt-bridge/blob/ebf68d11879c2798c5ec0735411b08d0bea4f287/contracts/L2/token/LivepeerToken.sol#L36-L43

function burn(address _from, uint256 _amount)
    external
    override
    onlyRole(BURNER_ROLE)
{
    _burn(_from, _amount);
    emit Burn(_from, _amount);
}

Using the burn() function of L2LivepeerToken, an address with BURNER_ROLE can burn an arbitrary amount of tokens from any address.

We believe this is unnecessary and poses a serious centralization risk.

A malicious or compromised BURNER_ROLE address can take advantage of this, burn the balance of a Uniswap pool and effectively steal almost all the funds from the liquidity pool (eg, Uniswap LPT-WETH Pool).

Recommendation

Consider removing the BURNER_ROLE and change burn() function to:

function burn(uint256 _amount)
    external
    override
{
    _burn(msg.sender, _amount);
    emit Burn(msg.sender, _amount);
}

https://github.com/livepeer/arbitrum-lpt-bridge/blob/49cf5401b0514511675d781a1e29d6b0325cfe88/contracts/L2/gateway/L2LPTGateway.sol#L34-L45

Mintable(l2Lpt).burn(from, _amount); in L2LPTGateway.sol#outboundTransfer() should also be replaced with:

Mintable(l2Lpt).transferFrom(from, _amount);
Mintable(l2Lpt).burn(_amount);

yondonfu (Livepeer) confirmed and resolved:

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

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 burn function trusted the caller to specify any source address instead of restricting burning to the caller's own tokens.

Impact

A malicious or compromised BURNER_ROLE address could burn a Uniswap pool's balance and effectively steal almost all the funds from the liquidity pool.

What the attacker needed

Control of an address with BURNER_ROLE

The fix

The BURNER_ROLE was removed and the burn function was changed to only burn the caller's own tokens, with the gateway updated to transfer then burn; the project confirmed it was fixed.

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 token contract has a special role called BURNER_ROLE that is allowed to destroy tokens. The problem was that this role could destroy tokens belonging to anyone, not just its own tokens. If someone with that role turned malicious, they could destroy all the tokens in a trading pool, which would let them take almost all the money in that pool.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

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.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.