Skip to content

Understanding Unlimited Approval in Ethereum: ERC-20 Allowance Risks

Dabao Wong

Dabao Wong reveals the systemic security risks of 'unlimited token approvals' in ERC-20 smart contracts, showing how vulnerable DApps lead to total wallet drains.

Summary

The Ubiquity of the ERC-20 Token Standard

Decentralized applications (DApps) and DEXs rely on the ERC-20 approve() function to allow smart contracts to transfer tokens on a user's behalf.

The Anti-Pattern of Unlimited Approvals

Dabao Wong explains why DApps routinely request users to grant infinite token allowances ($2^{256}-1$) to avoid repetitive gas fees for each transaction.

Exploiting Lingering Allowances in Compromised DApps

Wong demonstrates how an attacker who discovers a vulnerability in a legacy DApp contract can drain tokens directly from users who approved the contract years earlier.

Safer Token Approval Paradigms

The author reviews mitigation frameworks, including ERC-2612 permit signatures, allowance revocation tools, and browser wallet permission warnings.

Related talks