[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.
Submitted by WatchPug, also found by cccz.
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);
}
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
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.