---
title: "NFT and Token Approval Phishing: setApprovalForAll vs ERC-20 Permit"
description: "A single malicious signature can authorize third parties to drain an entire NFT collection or deplete fungible token balances weeks after the initial transaction, exploiting standard smart contract mechanics."
url: https://basisdesk.news/learn/approval-phishing-permit-vs-setapprovalforall
published: 2026-11-21T16:30:31.604Z
modified: 2026-11-21T16:30:31.604Z
section: Security & Hacks
author: Basis Desk Newsroom (AI-generated, source-verified)
sentiment: neutral
tickers: [USDC, USDT]
tags: [Security, Phishing, Smart Contracts, ERC-20, ERC-721, Permit2, EIP-712, EIP-2612, Wallets, Ethereum]
license: Quote with attribution to Basis Desk (basisdesk.news). Not financial advice.
---

# NFT and Token Approval Phishing: setApprovalForAll vs ERC-20 Permit

A single malicious signature can authorize third parties to drain an entire NFT collection or deplete fungible token balances weeks after the initial transaction, exploiting standard smart contract mechanics.

## Key points

- The ERC-721 setApprovalForAll function grants an operator permanent authority over every NFT in a collection, including assets acquired after the transaction.
- EIP-2612 Permit and Permit2 use off-chain cryptographic signatures that allow attackers to drain funds on-chain while paying the gas costs themselves.
- Disconnecting a wallet from a website interface does not revoke existing smart contract allowances on the blockchain ledger.
- Approvals persist indefinitely unless granted with an explicit deadline or manually reset to zero through an on-chain revocation transaction.

Approval phishing drains digital assets without needing to steal a victim's private key. Instead of compromising wallet seed phrases, attackers trick users into signing off-chain messages or on-chain transactions that grant broad permissions over their tokens. Because smart contract standards treat an authorization as valid until explicitly revoked or expired, a single signature granted to a malicious address or compromised proxy can empty an entire collection or balance long after the victim closes their browser [1] [2].

## The Mechanics of Smart Contract Approvals

Smart contracts cannot directly seize tokens from an external account without prior consent. When interacting with decentralized finance (DeFi) platforms or digital collectible marketplaces, users must grant external protocols permission to transfer assets on their behalf [1]. Under the Ethereum standard for fungible tokens, known as ERC-20, this authorization traditionally occurs through the `approve` function. 

When a user calls `approve`, they designate a specific spender address and a maximum token allowance [1]. To save users the transaction costs of repeatedly approving small amounts, applications frequently request an unlimited allowance. This broad permission persists indefinitely on the blockchain ledger until the account owner submits a new transaction that resets the allowance to zero [1]. If a malicious contract obtains this authorization, it can initiate transfer calls against the owner's balance whenever assets enter that account, making [unlimited token approvals](https://basisdesk.news/learn/erc-20-infinite-approval-risk-in-defi) a persistent structural vulnerability.

## NFT Approvals: The Reach of setApprovalForAll

Non-fungible tokens on Ethereum follow the ERC-721 specification, or its multi-token counterpart, ERC-1155 [2] [3]. In these standards, authorizing an exchange contract to list or settle sales for individual tokens involves distinct functions. A user can authorize the transfer of a single asset using `approve(address to, uint256 tokenId)` [2]. However, listing multiple items or facilitating regular trading across a portfolio makes individual approvals impractical and expensive due to accumulated gas fees.

To solve this friction, the ERC-721 and ERC-1155 standards introduced **setApprovalForAll** [2] [3]. This function accepts two parameters: an operator address and a boolean value set to true or false. Unlike the ERC-20 allowance, which specifies a finite quantity of tokens, `setApprovalForAll` grants an operator absolute authority to transfer every token the account holds within that specific smart contract collection [2]. It also applies automatically to any tokens from that collection that the user acquires in the future.

Phishing websites exploit this binary design. Malicious decentralized applications (dApps) clone legitimate marketplace interfaces, such as OpenSea or Blur, and prompt the victim to execute an on-chain transaction disguised as a routine listing or free mint. The transaction payload targets the underlying NFT smart contract, setting the attacker's contract as an authorized operator. Once confirmed on-chain, the attacker calls `transferFrom` to pull all existing tokens from the target collection directly into a secondary wallet without requiring any further input from the victim [2].

## The Shift to Gasless Signatures: EIP-2612 and Permit

On-chain approvals require network transaction fees, which can create a barrier to onboarding new users. To mitigate this overhead, developers introduced Ethereum Improvement Proposal 2612 (EIP-2612), which standardizes the **Permit** function for ERC-20 tokens [4]. The permit architecture uses cryptographic signatures structured under the EIP-712 standard for typed structured data [5].

Instead of submitting an on-chain transaction that consumes gas, the asset owner signs a typed data payload off-chain using their wallet [4]. This signature proves that the owner authorized a specific spender, a designated token allowance, a deadline timestamp, and a sequential account nonce [4]. The designated spender then broadcasts the signature on-chain inside a transaction, paying the required network fees themselves.

While this mechanism eliminates friction for honest decentralized exchanges, it introduces severe phishing vectors. Users frequently treat off-chain signature prompts as harmless because wallet interfaces historically displayed cryptographic hashes without clear human-readable context [5]. An attacker can present a signature request that looks like an account login or verification step. In reality, the victim signs an EIP-2612 permit that authorizes an exploit contract to draw down their tokens [4]. Because the message contains an off-chain authorization, the attacker can hold the signature and submit it to the blockchain at a strategically optimal moment.

To understand the broader implications of signature-based approvals, users must distinguish between direct contract allowances and the multi-step mechanics documented in [off-chain signature standards like Permit2](https://basisdesk.news/learn/eip-712-and-permit2-signatures).

## Shared Operators and Permit2 Architectures

Modern decentralized applications have combined continuous allowances with off-chain signatures through centralized routing contracts, most notably Uniswap's **Permit2** protocol [6]. Permit2 standardizes signature-based approvals across all ERC-20 tokens, including legacy assets that do not natively implement EIP-2612 [6].

Under this design, an account holder grants a single, traditional ERC-20 allowance to the canonical Permit2 smart contract [6]. Once the Permit2 contract holds this blanket allowance, the user signs individual, off-chain EIP-712 messages for daily trades, permitting Permit2 to route funds to specific applications [5] [6]. 

This architecture drastically improves capital efficiency, but it shifts the attack surface. If an account has already approved the canonical Permit2 contract for an asset like USD Coin ($USDC) or Tether ($USDT), that baseline on-chain permission remains active [1] [6]. If an attacker subsequently tricks that user into signing a malicious Permit2 off-chain message on a phishing website, the attacker can leverage the pre-existing on-chain allowance to drain the permitted amount immediately [6]. The victim does not need to submit an on-chain transaction or pay gas; the rogue off-chain signature alone authorizes the Permit2 contract to release their funds to the attacker [6].

## A Worked Example of Delayed Exploitation

Consider an investor managing an Ethereum address holding digital collectibles and fungible tokens. The user holds 10 non-fungible tokens from Collection Alpha, along with 25,000 $USDC. 

1. In January, the user interacts with an unvetted secondary marketplace aggregator to list one item from Collection Alpha. The interface prompts the user to execute `setApprovalForAll(operatorAddress, true)` [2]. The user approves the transaction on-chain. The user sells one NFT, leaving nine tokens in their wallet.
2. In March, the aggregator's routing contract is compromised by an external adversary who obtains the private keys controlling the operator contract, or the original aggregator was a targeted phishing deployment from inception.
3. In July, the user purchases three additional NFTs from Collection Alpha via an unrelated decentralized exchange, bringing their wallet total to 12 tokens.
4. In November, without any new action from the user, the attacker initiates a batch transaction containing 12 `transferFrom` calls referencing the operator approval granted ten months earlier [2]. Because `setApprovalForAll` applies to the entire smart contract collection indefinitely, all 12 NFTs are instantly transferred to the attacker's designated address [2].
5. Simultaneously, the user previously authorized the Permit2 contract for an infinite allowance of $USDC while using a decentralized swap [6]. In November, while attempting to claim an unverified airdrop, the user signs an off-chain EIP-712 typed message disguised as an account verification signature [5]. The signature sets an allowance of 25,000 $USDC for the attacker's contract via Permit2 [6].
6. The attacker submits the signed message to the Permit2 contract on-chain, pays the gas fee, and calls `transferFrom` to sweep the entire 25,000 $USDC balance [6]. 

In both instances, the victim did not approve a transfer transaction at the moment of the theft; they merely triggered or relied upon historical permissions that remained valid across the network [1] [2].

## Common Misconceptions

* **Disconnecting a wallet from a dApp revokes smart contract permissions.** Revoking an application's connection in a browser extension or hardware wallet only stops the website interface from querying the user's public address and sending signature requests. It has zero effect on the blockchain ledger. Once `setApprovalForAll` or an ERC-20 `approve` call is mined, that permission is an immutable state change on Ethereum that remains valid until a new, explicit revocation transaction is confirmed [1] [2].
* **Off-chain signatures cannot move funds because they do not cost gas.** While signing an EIP-712 typed data hash does not cost the signer network gas, the signature itself represents cryptographic authority [4] [5]. Anyone in possession of that valid signature—including an attacker running an automated bot—can broadcast it within their own transaction, pay the gas fee, and trigger smart contracts like Permit2 to move the victim's assets [4] [6].
* **Permit signatures only affect funds currently held in the wallet.** If a user signs a Permit approval granting an allowance that exceeds their current balance, or signs an open-ended Permit message with a future deadline, the allowance can persist until that expiration timestamp passes [4]. Any assets matching that token contract deposited into the wallet prior to the deadline can be seized immediately by the authorized entity [4].

## How This Connects to the Market

Approval phishing represents a shift away from infrastructure attacks, such as smart contract logic exploits or exchange compromises, toward direct user exploitation. As decentralized protocols standardize on gasless signatures and shared approval hubs to make products user-friendly, attackers leverage those same standards to obscure malicious permissions.

Institutional custodians and retail software providers have responded by deploying stricter interface safeguards, such as proactive allowance revoking tools, transaction simulation engines, and clear-signing protocols [5]. Users frequently interact with permissions via third-party web add-ons, making [browser extension security](https://basisdesk.news/learn/browser-extension-security-crypto) a vital baseline defense. As network operators develop modern standards like [ERC-7730 for clear signing](https://basisdesk.news/learn/clear-signing-erc7730-explained), wallets will increasingly translate raw cryptographic data into plain human language before a signature is executed, limiting the viability of blind approval phishing across the broader crypto ecosystem.

## FAQ

**What is the primary difference between approve and setApprovalForAll for NFTs?**

The approve function authorizes a third party to manage a single, specific token ID within an ERC-721 contract. The setApprovalForAll function authorizes an operator to transfer every existing and future token ID owned by that wallet inside the entire collection contract.

**Can signing a message without paying gas compromise my crypto assets?**

Yes. Cryptographic signatures constructed under EIP-712 and EIP-2612 authorize token transfers off-chain. An attacker can broadcast your valid signature in their own transaction, cover the gas fee, and extract your tokens via smart contracts like Permit2.

**How can an on-chain approval be revoked?**

An on-chain approval can only be canceled by submitting an explicit blockchain transaction that overwrites the existing state. For ERC-20 tokens, this involves calling approve with an allowance of zero. For NFTs, it requires calling setApprovalForAll with the operator set to false.

**Does my hardware wallet protect me against approval phishing?**

A hardware wallet prevents unauthorized parties from extracting your private key, but it cannot prevent you from approving a malicious transaction. If you confirm a setApprovalForAll transaction or off-chain Permit signature on your physical device, the smart contract rules will still execute normally.

## Sources

1. [ERC-1155 Multi-Token Standard](https://ethereum.org/developers/docs/standards/tokens/erc-1155/) — Ethereum Foundation
2. [ERC-721 Non-Fungible Token Standard](https://ethereum.org/developers/docs/standards/tokens/erc-721/) — Ethereum Foundation
3. [ERC-20 Token Standard](https://ethereum.org/developers/docs/standards/tokens/erc-20/) — Ethereum Foundation
4. [EIP-712: Typed Structured Data Hashing and Signing](https://eips.ethereum.org/EIPS/eip-712) — Ethereum Improvement Proposals
5. [EIP-2612: Permit Extension for ERC-20 Signed Approvals](https://eips.ethereum.org/EIPS/eip-2612) — Ethereum Improvement Proposals
6. [Permit2 Smart Contract Documentation](https://developers.uniswap.org/docs/protocols/permit2/overview) — Uniswap Labs

---
Basis Desk Newsroom · AI-generated, source-verified · https://basisdesk.news/about/how-we-use-ai
