Skip to content
Access control Audit finding Intermediate

[WP-M0] MINTER_ROLE can be granted by the deployer of L2LivepeerToken and mint arbitrary amount of tokens

The L2LivepeerToken contract allows any address with the MINTER_ROLE to mint an arbitrary amount of tokens. If the deployer's private key or a MINTER_ROLE address is compromised, an attacker could mint unlimited LPT tokens.

WatchPug Follow

Originally disclosed on Code4rena

Submitted by WatchPug.

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

function mint(address _to, uint256 _amount)
    external
    override
    onlyRole(MINTER_ROLE)
{
    _mint(_to, _amount);
    emit Mint(_to, _amount);
}

Using the mint() function of L2LivepeerToken, an address with MINTER_ROLE can burn an arbitrary amount of tokens.

If the private key of the deployer or an address with the MINTER_ROLE is compromised, the attacker will be able to mint an unlimited amount of LPT tokens.

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

Recommendation

Consider removing the MINTER_ROLE, make the L2LivepeerToken only mintable by the owner, and make the L2Minter contract to be the owner and therefore the only minter.

yondonfu (Livepeer) acknowledged:

Planning on keeping the role since the L2LPTGateway needs to be given minting rights as well in addition to the L2 Minter.

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 grants minting privileges to a role (MINTER_ROLE) that can be assigned to multiple addresses, including the deployer, rather than restricting minting to a single trusted owner contract.

What the attacker needed

Compromise of deployer or MINTER_ROLE private key

The fix

The recommendation was to remove the MINTER_ROLE and make the L2LivepeerToken mintable only by the owner, with the L2Minter contract as the sole owner and minter; however, the project acknowledged and planned to keep the role for the L2LPTGateway.

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 for a token on a blockchain. The contract has a special role called MINTER_ROLE that lets certain addresses create new tokens out of thin air. The report says this is risky because if someone steals the key to one of those addresses, they can create as many tokens as they want, which could crash the token's value.

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.