# Bypass parsing of transaction data, users on the phishing site will transfer/approve  ERC20 tokens without being alerted

Truncating two bytes from ERC20 transfer/approve calldata to a solc<0.5.0 token made MetaMask show a generic contract call, hiding recipient and amount from the signing user.

- Payout: $1,000
- Severity: low
- Program: MetaMask
- Found by: ronnyx2017
- Disclosed: 2023-04-10
- Write-up quality: 7/10
- Original: https://hackerone.com/reports/1651429
- Library page: https://bugbountylibrary.com/r/h1%3A1651429
- Tags: area:web3 domain:browser domain:web3 impact:funds-loss kind:bounty platform:hackerone sev:low tech:evm tech:solidity technique:parser-differential vuln:info-disclosure

**Target:** MetaMask browser extension transaction confirmation UI / ERC20 calldata decoder
**Root cause:** MetaMask's decoder rejected or failed to interpret calldata whose length did not match the ABI-encoded parameter sizes, falling back to a generic contract-call display; solc<0.5.0 contracts still execute such short calldata, zero-padding missing bytes.
**Steps:**
1. Deploy an ERC20 token compiled with solc 0.4.26 (no calldata length check).
2. Build a normal `transfer` calldata: `0xa9059cbb` + 32-byte address + 32-byte uint256 amount.
3. Remove the last byte of the amount word so calldata is 1 byte short.
4. Send this truncated calldata as a transaction from a dapp connected to MetaMask.
5. Observe MetaMask confirmation shows a generic contract call with no recipient, amount, or token symbol; on-chain the transfer still executes with the amount zero-padded.
**How found:** Researcher knew solc<0.5.0 contracts don't validate calldata length and zero-pad missing bytes, then hypothesized MetaMask's parser would mishandle the non-standard length and tested by deleting the last byte of a transfer calldata.
**Exploitation:** Phishing site connects to victim's MetaMask and submits a truncated transfer/approve calldata to a legacy token contract; the confirmation UI omits the recipient and amount, so the victim signs a transfer or unlimited approval without seeing the value.
**Insight:** When auditing wallet transaction-display code, test ABI decoders with malformed calldata lengths (truncated/oversized words) against legacy contracts that tolerate them; a parser that bails to a generic view silently removes the security-relevant fields the user needs to consent.

## Proof of concept (copied exactly from the original report)

**Truncated ERC20 transfer calldata missing last byte**

```
sighash ->          0xa9059cbb
address to ->       000000000000000000000000C588e338FdBB2CC523a1177f3D18e87FF5A16a6b
uint256 value ->    00000000000000000000000000000000000000000000000000000000009897
```

**Deploy solc 0.4.26 ERC20 token test contract**

```
Click the button `Create Token` will deploy a erc20 token with compiler solc 0.4.26. 
contract source code: {F1840809}
```

