BURNER_ROLE can burn any amount of EthErc20 from an arbitrary address
The EthErc20 contract's forceBurn function lets any address with the BURNER_ROLE burn tokens from any account without that account's consent. An attacker holding that role could destroy arbitrary amounts of other users' tokens.
Submitted by cccz, also found by 0x1f8b
Impact
Same as https://github.com/code-423n4/2022-01-livepeer-findings/issues/194
function forceBurn(address account, uint256 amount) external override {
require(hasRole(BURNER_ROLE, _msgSender()), "BURNER role is required");
_burn(account, amount);
}
Using the forceBurn() function of EthErc20, 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.
Proof of Concept
https://github.com/skalenetwork/ima-c4-audit/blob/main/contracts/schain/tokens/EthErc20.sol#L64-L67
Recommended Mitigation Steps
Update forceBurn function for only owner can burn his tokens.
cstrangedk (SKALE) disputed and commented:
Issue is acknowledged and work is pending on the roadmap. SKALE chain owners must carefully manage BURNER_ROLE, and end-users carefully monitor role.
GalloDaSballo (judge) commented:
This finding boils down to the flexibility of the role system against a more immutable address being set on the constructor, ultimately the role is contingent on configuration and as such I believe the finding to be valid and of medium severity.
In the majority of configurations this will be a non-issue, however end users may want to monitor how roles are set and how they change over time to avoid their tokens being burned
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 forceBurn function only checks that the caller has BURNER_ROLE and then burns from any account passed in, without requiring the account's consent or restricting the burn to the caller's own tokens.
Impact
An address with BURNER_ROLE could burn an arbitrary amount of tokens from any address, though the judge noted this is a non-issue in most configurations and depends on how roles are managed.
What the attacker needed
Caller holds BURNER_ROLE
The fix
The forceBurn function should be changed so that only the owner can burn their own tokens.
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 is that this role can destroy tokens belonging to anyone, not just its own, so whoever holds the role can wipe out other people's balances. This is a centralisation risk because it gives one privileged account power over everyone's funds.
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.