Normal Behavior: An ERC20 token should correctly maintain user balances, total supply, and allowances. Operations like transfer, mint, burn, and approve should revert on invalid actions (e.g., insufficient balance or allowance) and never corrupt state.
Issue: In ERC20Internals.sol, critical functions such as _transfer, _burn, _mint, and _spendAllowance are implemented entirely in Yul without proper overflow/underflow checks or state validation. This allows balances, allowances, and total supply to silently underflow or overflow, breaking ERC20 invariants and potentially giving users unintended token amounts.
Likelihood:
Any user or contract interacting with the ERC20 functions (transfer, transferFrom, mint, burn) triggers the vulnerability during normal token operations.
Malicious actors can exploit the Yul implementation to create unexpected balances, bypass restrictions, or drain tokens, especially when large amounts are involved.
Impact:
Token balances or total supply can underflow or overflow, allowing attackers to mint or burn tokens in unintended ways.
DeFi protocols relying on this token may suffer financial losses, broken accounting, or contract failure.
The PoC demonstrates how the low-level Yul implementations in ERC20Internals can be exploited. By attempting operations that exceed balances or allowances, an attacker can trigger underflows or incorrect state changes. This could allow them to mint, burn, or transfer tokens in unintended ways, potentially draining a user’s tokens or breaking DeFi protocol accounting.
Description
The Token‑0x ERC20 implementation heavily relies on Yul for balance and allowance management, which introduces risks of underflows, overflows, zero-address transfers, and incorrect event emissions. To mitigate these risks, all state-changing operations (mint, burn, transfer, approve, and allowance updates) should include strict input validation, use Solidity 0.8+ built-in arithmetic safety, enforce correct allowance logic, ensure proper ERC20 event emission, and restrict mint/burn operations to authorized addresses. Minimizing Yul in critical operations and keeping it only for non-state-changing, view-heavy functions can significantly reduce vulnerabilities.
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.