The ERC20 core implementation contains a critical arithmetic safety flaw in the token minting logic.
The _mint() function inside ERC20Internals.sol performs raw addition in inline assembly without any overflow protection.
If the mint amount is large enough, adding to the current total supply or user balance can overflow, wrapping around to a small number and effectively resetting balances or supply. This permanently corrupts both the global supply accounting and individual balances.
Although _mint() is marked internal, any child contract can expose this functionality through a public or external wrapper, intentionally or accidentally, enabling arbitrary token creation.
Likelihood: High
The contract is designed for inheritance.
Arithmetic is performed unchecked in assembly.
No validation exists for total supply or account balance overflow.
Impact: Critical
Arbitrary inflation of user balances.
Total supply overflow and corruption.
Broken token economics and permanent protocol integrity loss.
The following PoC demonstrates that minting via a malicious child contract can overflow balances or supply.
The test passes, confirming that unchecked addition causes silent overflow and state corruption.
Add explicit overflow protection before performing arithmetic inside _mint():
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.