Skip to content

ERC20 Token Burn Vulnerability

Description

The burn function allows anyone to burn tokens of other accounts, potentially leading to unauthorized token destruction.

Examples

Insecure Code

solidity
function burn(address account, uint256 amount) public { _burn(account, amount); }

Secure Code

solidity
function burn(uint256 amount) public { _burn(msg.sender, amount); }

Remediation

Modify the burn function to only allow the token owner to burn their own tokens, for example by using `msg.sender` or `_msgSender()` as the account to burn from.

Rule Details

FieldValue
IDCODE-0099
CategoryCrypto
SeverityCRITICAL
CWECWE-284
ConfidenceLOW
ImpactHIGH
LikelihoodHIGH
ExploitabilityEASY
Tagserc20, token burn, access control
OWASPN/A

References