Skip to content
Access control Audit finding Beginner

[WP-M2] DEFAULT_ADMIN_ROLE can approve arbitrary address to spend any amount from the L1Escrow contract

The L1Escrow contract's approve function lets any address with DEFAULT_ADMIN_ROLE approve an arbitrary spender to spend any amount of tokens held by the contract. A malicious or compromised admin could use this to steal all funds from the escrow.

WatchPug Follow

Originally disclosed on Code4rena

Submitted by WatchPug.

https://github.com/livepeer/arbitrum-lpt-bridge/blob/ebf68d11879c2798c5ec0735411b08d0bea4f287/contracts/L1/escrow/L1Escrow.sol#L21-L28

function approve(
    address _token,
    address _spender,
    uint256 _value
) public onlyRole(DEFAULT_ADMIN_ROLE) {
    ApproveLike(_token).approve(_spender, _value);
    emit Approve(_token, _spender, _value);
}

L1Escrow.sol#approve() allows an address with DEFAULT_ADMIN_ROLE can approve an arbitrary amount of tokens to any address.

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

A malicious or compromised DEFAULT_ADMIN_ROLE address can take advantage of this, and steal all the funds from the L1Escrow contract.

Recommendation

Consider removing approve() function and approve l1LPT to l1Gateway in the constructor.

yondonfu (Livepeer) acknowledged:

Likely won’t change as we want to preserve the ability for protocol governance to move the LPT from the L1Escrow in the event of a L2 failure.

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 approve function gives the admin role the power to approve arbitrary spenders for any amount, which is unnecessary for normal operation and creates a centralisation risk.

What the attacker needed

Compromised or malicious admin

The fix

The recommendation is to remove the approve function and instead approve l1LPT to l1Gateway in the constructor, but the project acknowledged and likely won't change to preserve governance ability.

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 holds tokens and has an admin role. The admin can call a function that lets any other address spend those tokens. If the admin's key is stolen or the admin turns bad, they can take all the tokens.

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.