Describe the normal behavior in one or more sentences:
A correct ERC20 burn implementation reduces an account's balance and totalSupply only when the account has at least value tokens and totalSupply is at least value. If those conditions are not met, the function reverts and leaves state unchanged.
Explain the specific issue or problem in one or more sentences:
In this implementation, _burn uses unchecked subtraction on both totalSupply and the account balance. There is no check that the account has enough balance and no underflow guard. When value exceeds the account's balance or the current totalSupply, both values underflow and wrap to very large numbers instead of reverting, corrupting core ERC20 accounting.
Likelihood:
Reason 1 // In common real deployments, burn is exposed to holders or to roles that are not perfectly locked down. Whenever a caller with access to burn passes an amount larger than their balance, the unchecked subtraction path is reached and underflow occurs.
Reason 2 // Even where burn is intended for internal use only, role misconfiguration and access leaks are frequent in real systems. Once any such caller can trigger burn with an excessive amount, the underflow always happens, because there is no defensive check in the implementation.
Impact:
Impact 1 : An attacker can underflow their balance, causing it to wrap to a huge value (near 2^256 - 1), effectively granting themselves an enormous number of tokens. This enables draining of DEX liquidity pools, manipulation of governance, and other forms of value theft.
Impact 2 : totalSupply also underflows and becomes incorrect. All downstream integrations that depend on sane supply and balances, such as lending markets, accounting tools, and analytics, will operate on corrupted data and may break or misbehave permanently.
The PoC shows that burning more tokens than owned leads to a wrapped balance and totalSupply instead of reverting, allowing the attacker to inflate their balance and corrupt core ERC20 accounting.
If you must keep the Yul implementation, add equivalent require style checks before performing subtraction and revert on underflow instead of allowing wrapped values to be written back to storage.
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.