Root + Impact
Attackers can craft calldata that forces the Yul-based transfer/approval routines to read from invalid memory locations, resulting\
incorrect from, to, or amount values,
corrupted balance mappings,
unauthorized transfers,
total supply inconsistencies.
This compromises fund integrity, accounting correctness, and ERC20 compliance.m
Token-0x uses custom Yul blocks inside Solidity functions (transfer, approve, transferFrom) to improve gas efficiency. Normally, calldata values (from, to, amount) should be validated and safely loaded before writing to storage.
The contract directly uses Yul calldatacopy and mload without validating calldata length. When calldata is too short or malformed, mload reads uninitialized memory, which then gets used as addresses or amounts. This enables arbitrary balance changes and unauthorized transfers.
Likelihood:
The vulnerability occurs whenever Token-0x functions process calldata shorter than the required ABI format.
The Yul implementation is triggered on every call to transfer, approve, and transferFrom, so attackers can exploit this continually.
Impact:
Attackers can cause arbitrary balance inflation or deflation by manipulating _amount.
Attackers can redirect tokens by forcing _to to read from uninitialized memory.
This works because the Yul implementation treats missing calldata as valid memory.
Add explicit ABI decoding in Solidity, then pass validated values into Yul.
Use calldatasize() checks inside the assembly block.
Avoid relying solely on Yul for argument parsing unless all validations are included.
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.