All articles
Web3 FoundationsJuly 27, 20269 min read

Approval phishing: how one signature drains your whole wallet

A security auditor explains approval phishing: how approve, increaseAllowance, and setApprovalForAll get abused, why the drain lands later, and how to revoke.

By Carlos (Bloqarl)

You click a link for a token airdrop. The page looks right, the wallet pops up, and it asks you to sign one thing to "verify eligibility" or "enable claiming." You approve it, nothing happens, and you shrug and move on. Three days later your tokens are gone. No password was stolen, no seed phrase leaked, no alert fired. You did not get hacked in the way people picture hacking. You signed a permission slip, and someone used it.

This is approval phishing, and it is the quiet engine behind some of the largest wallet drains in crypto history. It does not break the blockchain or crack your keys. It abuses a normal, necessary feature that every DeFi app relies on, and it turns that feature against you with a single click you barely remember making. The reason it works on careful people is that the dangerous step looks identical to the harmless one. Both are "just a signature." As a security auditor, this is the attack I most wish beginners understood before they ever connect a wallet to anything, because unlike a bad trade, an approval you sign to a stranger is not something you can undo by waiting.

TL;DR

  • Approval phishing tricks you into granting a contract permission to move your tokens, then drains them later using that permission.
  • The abused functions are approve, increaseAllowance, and setApprovalForAll — all legitimate parts of how tokens work, all weaponizable.
  • The drain happens minutes to weeks after you sign, which is why victims rarely connect the signature to the loss.
  • Badger DAO lost roughly $121M in 2021 this exact way — a script injected extra approval requests into a real front-end (CoinDesk).
  • Your defense: read the method and spender before signing, grant finite amounts, and check your open approvals at revoke.cash.

What is approval phishing?

Approval phishing is a scam that tricks you into signing a token approval that hands an attacker's contract permission to move your funds, so it can drain them at a later moment of its choosing. It is a form of phishing, but instead of stealing a secret from you, it gets you to authorize an action with your own hand. The attacker never learns your seed phrase and never touches your private keys. They do not need to. Once you sign the approval, they hold a standing permission that keeps working until you revoke it.

That is the part people miss. In traditional finance, fraud usually means someone got your card number or your login. In self-custody, the attacker does not steal access — you grant it. The signature is the whole crime, and it is valid because you really did sign it.

How does a token approval actually work?

An approval is permission for a smart contract to move a specific token on your behalf. It exists for a good reason: when you swap on a decentralized exchange or deposit into a lending pool, the app's contract needs to pull tokens out of your wallet. You cannot do that without first saying "this contract is allowed to move my USDC." That "yes" is an approval, and it is a completely normal, unavoidable part of using DeFi.

There are three function calls attackers abuse, and it is worth knowing their names because your wallet will sometimes show them raw:

  • approve (method ID 0x095ea7b3) — grants a contract permission to spend up to a set amount of one ERC-20 token. Legitimate apps often request the exact amount you are trading. Drainers request an unlimited amount.
  • increaseAllowance (0x39509351) — bumps an existing allowance up. This is the one the Badger DAO attacker used, because it slips into a normal flow and reads as routine.
  • setApprovalForAll (0xa22cb465) — the NFT version. A single true here gives one operator permission to move every NFT in a collection out of your wallet. There is almost no legitimate reason to grant this to a random claim page.

None of these ask for your seed phrase. None of them look scary in the wallet if you do not read them. That is exactly the problem: the signature that funds your swap and the signature that empties your wallet are the same shape.

Why does the drain happen later, not when I sign?

Because an approval and a transfer are two separate steps, and the attacker controls the timing of the second one. When you sign the approval, nothing leaves your wallet yet. You have only granted permission. The wallet shows no outgoing tokens, so it feels safe — you approved something, and your balance is untouched. This is the trap's cleverest feature.

The attacker's contract now holds a standing allowance. At a moment of their choosing — often batched with hundreds of other victims to save gas, sometimes days or weeks later — a sweeper contract calls transferFrom and pulls your tokens out. You never see a second prompt, because you already gave them the right to do it. By the time the funds move, you have long forgotten the sketchy "claim" page, so you do not even connect the loss to the signature. This delay is why approval phishing is so hard to learn from: cause and effect are separated in time.

It is the same mechanic whether the lure is a fake airdrop, a fake NFT mint, or a "your funds are at risk, migrate now" panic message. The costume changes; the skeleton is always get one approval, drain later. If you want the wider map of how these lures reach you, the pillar on how Web3 users actually get hacked lays out the delivery side, and common crypto scams shows where approval drainers sit among the other shapes.

What happened in the Badger DAO hack?

Badger DAO was drained of roughly $121 million in December 2021, and it is the cleanest real-world example of approval phishing at scale. What makes it chilling is that users were on the real Badger website. Attackers had compromised a Cloudflare API key and used it to inject a malicious script into the front-end, which quietly inserted extra token-approval requests into the app's normal transaction flow (CoinDesk).

So users who thought they were interacting with a protocol they trusted were actually approving the attacker's address to move their tokens. The approvals sat quietly. Then on December 2, 2021, the attacker drained around $121M from roughly 200 accounts in about ten hours, using the allowances victims had already granted (Halborn). Microsoft later coined the term "ice phishing" for this class of attack — freezing you into a false sense of safety while you sign away control (Microsoft Security Blog).

The lesson I take from Badger as an auditor: "is this the real site?" is not enough. It was the real site. The only reliable defense is reading the approval itself — what method, what spender, what amount — before you sign.

How do I read and revoke token approvals?

You defend against approval phishing in two places: before you sign, and after. Both are simple once you know where to look.

Before you sign, read three fields in the wallet prompt:

  1. Method. If a "claim your reward" page triggers approve, increaseAllowance, or setApprovalForAll, stop. Claiming a genuine airdrop does not require granting spending permission over tokens you already hold.
  2. Spender. This is the address you are authorizing. If it is an address you do not recognize and cannot verify, do not sign.
  3. Amount. A finite approval limits the blast radius. An "unlimited" or "max" allowance means the contract can take everything, forever, until you revoke. Prefer wallets that let you set an exact amount, and prefer apps that request one.

After the fact, you can see and cancel every approval you have ever granted. Tools like revoke.cash connect to your wallet, list your open allowances per token and per NFT collection, and let you revoke any you no longer trust. Revoking is itself an on-chain transaction, so it costs a little gas, but it permanently kills the permission. I tell every beginner to do a revoke sweep periodically, and immediately if they suspect they signed something on a bad page. Once the allowance is gone, the standing permission is gone — the sweeper contract has nothing left to call.

If you want to feel this in your hands rather than just read about it, the Approval Phishing drill in Defense drops you onto a fake claim page and makes you decide, with a live wallet prompt, whether to sign. The signature-based cousin of this attack — where you do not even send a transaction — is covered in permit and signature phishing, and it is worth reading next, because it defeats several of the habits that stop approval phishing.

Related questions

Can approval phishing steal my crypto without my seed phrase? Yes, and that is the whole point. Approval phishing never needs your seed phrase or private keys. It gets you to sign a token approval that grants an attacker's contract permission to move your funds, then it uses that permission later. Your secrets stay safe the entire time — you authorized the theft yourself, which is exactly why prevention has to happen at the moment you sign.

Why did my tokens disappear days after I signed something? Because an approval and the actual transfer are two separate steps. When you sign the approval, nothing leaves your wallet — you have only granted permission. The attacker's contract holds that standing allowance and calls transferFrom whenever it chooses, often days or weeks later and batched with other victims. The delay is deliberate, and it is why people rarely connect the loss back to the signature that caused it.

Is setApprovalForAll dangerous? It can be. setApprovalForAll grants one operator permission to move every NFT in a collection out of your wallet, and it stays active until you revoke it. Real marketplaces use it legitimately, but a random "claim your free NFT" page asking for it is a drainer. Never grant it to a site you reached through a link in a DM, ad, or email, and check your open operator approvals at revoke.cash.

How do I check what I have already approved? Use an approval-management tool like revoke.cash. Connect your wallet and it lists every open allowance and NFT operator approval you have granted, per token and per collection. Revoke anything you do not recognize or no longer use. Revoking is an on-chain transaction that costs a little gas, but it permanently cancels the permission so it can never be used to drain you.

Was the Badger DAO hack a smart contract bug? No — the contracts were fine. The Badger DAO drain of roughly $121M in December 2021 happened because attackers injected a malicious script into the real front-end and tricked users into approving the attacker's address. It is the defining example of approval phishing: the exploit targeted human signatures, not the protocol code, which is why reading what you sign matters more than trusting the domain.

Tagged

Wallet SecurityCrypto ScamsWeb3 Security