Normal Behavior: Standard ERC20 implementations must ensure that arithmetic operations (minting, burning, transferring) are safe from overflows and underflows. For example, burning tokens should revert if the user's balance is insufficient, and minting should revert if it causes the total supply to overflow.
Specific Issue: The Token-0x implementation utilizes inline assembly (Yul) for gas optimization in _burn, _mint, and _transfer but fails to include the necessary manual arithmetic checks. This absence allows the _burn function to underflow a user's balance and the _mint function to overflow the total supply or a user's balance.
Likelihood: High
The contract is designed as a base ERC20 implementation intended for inheritance by other protocols.
The burn functionality is a standard and widely used ERC20 extension (e.g., ERC20Burnable), making it highly probable that inheriting contracts will expose this vulnerable _burn function to end-users.
Impact:High
An attacker with zero balance can trigger an underflow by burning tokens, setting their balance to 2^256 - 1 (effectively infinite tokens).
This completely destroys the token's economy and renders the protocol using it useless.
The following test case demonstrates how a user with 0 tokens can burn 1 token to achieve a max uint256 balance.
Add manual arithmetic checks within the assembly blocks to prevent overflows and underflows.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.
The contest is complete and the rewards are being distributed.