Guide 9 min read

Wallet Drainers Start With Token Approval Risk

A seed phrase is not the only failure path. ERC-20 allowances, NFT operator approvals, permit signatures, and unlimited spender grants can let a malicious or compromised contract move assets later.

By Protocol Report Editorial | Updated June 11, 2026
Abstract crypto wallet approval ledger showing token allowances, spender contract paths, and a revoke control
Short Version

Many wallet security guides still center on seed phrases, malware, and exchange withdrawal controls. Those risks are real, but they miss a common on-chain failure path: the user keeps control of the wallet, yet a contract already has permission to move tokens or NFTs. The approval can be legitimate at the time it is granted and dangerous later when the spender is malicious, compromised, upgraded, spoofed, or no longer needed.

Token approvals are not bugs by themselves. ERC-20, ERC-721, permit signatures, and router-style approval systems exist because decentralized applications need a way to move assets after a user authorizes them. The security problem is overbroad, stale, unclear, or phished authorization. Wallets, dapps, exchanges, and community operators should treat approvals as live permissions that need limits, review, and revocation.

Key Takeaways

  • check_circle ERC-20 `approve` grants a spender permission to withdraw up to a value; it is not the same action as an immediate transfer.
  • check_circle ERC-721 `setApprovalForAll` can let an operator manage every NFT in a collection for an owner until revoked.
  • check_circle Permit signatures can change allowances without an on-chain approval transaction from the token holder.
  • check_circle Unlimited approvals reduce friction but create durable exposure if the spender is malicious, compromised, or no longer trusted.
  • check_circle Wallet UX should show spender address, verified contract context, asset, amount, expiry where available, and whether the approval is unlimited.
  • check_circle Users should review and revoke stale approvals, especially after phishing, contract compromise, wallet migration, or high-value asset movement.

The Approval Is The Permission

ERC-20 defines the `approve` and `transferFrom` pattern so one address can authorize another address to spend tokens up to a specified allowance. The standard says `transferFrom` is used for a withdraw workflow and that `approve` allows a spender to withdraw from the account multiple times up to the approved value. That is useful for swaps, lending, staking, subscriptions, and vault deposits, but it also means an approval can outlive the moment the user thought about.

The security mistake is treating approval as if it were only a confirmation step for the current transaction. It is a permission record on the token contract. If the spender address remains approved, later transactions can use that allowance without the user approving that exact movement again. That is why a wallet can be drained even when the seed phrase was never typed into a phishing page.

Unlimited Is Operational Debt

Many dapps ask for a maximum allowance to avoid repeated approvals and gas costs. That can make sense for a frequently used router or vault, but it turns a one-time convenience into standing authority. If the spender contract is malicious, compromised, upgradeable in an unsafe way, or confused with a lookalike, the user has handed it far more room than the next trade required.

Unlimited approvals are not automatically unacceptable. Some users intentionally grant them to trusted contracts to reduce friction. The problem is that most approval screens do not make the lifetime and blast radius clear enough. A safer default is a bounded amount, a short review cycle, and a habit of revoking approvals that are not actively needed.

NFT Operators Are Broader Than Single-Asset Approvals

ERC-721 includes both single-token approval and operator approval. The `setApprovalForAll` function enables or disables a third party as an operator for all of an owner's assets in a collection. That is useful for marketplaces and custody workflows, but it is also a high-impact permission. A malicious operator does not need to steal every NFT immediately for the approval to be dangerous. It can wait for valuable assets to arrive later.

For collectors, the practical rule is simple: a collection-wide operator approval should have a purpose, a known spender, and an expected end date. If the marketplace listing, lending position, or migration is finished, revoke the operator approval. If a collection rises in value, review old approvals before moving assets into the wallet that holds it.

Permit Signatures Change The UX

ERC-2612 extends ERC-20 with `permit`, allowing an allowance to be changed through a signed EIP-712 message rather than a direct approval transaction sent by the token holder. OpenZeppelin's documentation describes ERC20Permit as a way to change an account's allowance by presenting a signed message. That improves usability because the holder does not need ETH for a separate approval transaction, but it also moves risk into the signing prompt.

The defensive question becomes what the user is signing. A permit can contain an owner, spender, value, nonce, deadline, token contract, and chain context. If a wallet hides those details, a user may think they are signing a login, claim, listing, or gasless action while actually granting spend authority. Wallets should make permit prompts visually distinct from ordinary sign-in prompts and should highlight unlimited values or long deadlines.

Router And Aggregator Patterns Need Extra Clarity

Permit2-style systems and modern routers try to reduce approval friction while adding richer transfer patterns. Uniswap's Permit2 documentation describes signature-based transfers and allowance transfers, including permissions that can be bounded by amount and duration. That is the right direction because it gives developers tools for more precise authorization, but it also introduces another contract and another vocabulary that users may not understand.

Dapps should not hide that complexity behind a generic approve button. They should show which contract receives the approval, which downstream protocol will use it, whether the approval is reusable, when it expires, and how to revoke it. If a transaction cannot explain those facts clearly, the safer product choice is to request a smaller approval or split the workflow into reviewable steps.

Response After A Suspect Approval

If a user believes they approved the wrong spender, speed matters. Revoking the approval can stop future pulls, but it cannot reverse assets already moved. The response should check approval state across the relevant chains, revoke the spender or reduce allowance to zero where supported, move remaining high-value assets to a clean wallet when appropriate, and preserve transaction hashes, phishing URLs, and signed messages for investigation.

Communities and exchanges should treat approval education as part of onboarding, not as a footnote after a theft. Users need to understand that a hardware wallet can still sign a bad approval, that a clean seed phrase does not remove stale spender grants, and that revocation tools are not magic recovery tools. They are maintenance controls for permissions that already exist on-chain.

Checklist

  • Before approving, verify the spender contract, chain, token, amount, and whether the value is unlimited.
  • Prefer limited approvals for one-time swaps, claims, listings, and temporary workflows.
  • Review NFT `setApprovalForAll` grants separately from single-token approvals.
  • Treat permit signatures as approval-capable actions, not harmless login prompts.
  • Revoke stale approvals after marketplace listings, migrations, airdrop claims, bridge use, or suspected phishing.
  • Use a separate wallet for high-value storage and avoid granting routine dapp approvals from it.
  • After a suspect approval, revoke first, move remaining assets if needed, and preserve transaction evidence.

Sources

Related Articles

Continue Reading

Token-gated community authentication diagram with wallet signature, nonce, verified domain, Discord role gate, and revocation controls
Guide

Token-Gated Discord Starts With Signature Risk

Token-gated communities often ask members to connect wallets, sign messages, and receive Discord roles. The danger is not only asset approval; it is session, domain, and role integrity.

Abstract secure messaging phone, suspicious link nodes, and blocked spyware infrastructure path
News Analysis

WhatsApp's NSO Update Shows Spyware Moved To Phishing

WhatsApp says it disrupted NSO-linked spear phishing attempts and asked a court to enforce an injunction against NSO. The practical lesson is that encrypted chat still needs link safety, device hardening, and targeted-user response.