Skip to content
NFTVenue Ledger
Directory

Erc721 Erc1155 Eip712 Permit Security

Uniswap Permit2 Security Audit: AllowanceTransfer vs SignatureTransfer & Witness Phishing

Deploying at canonical address 0x000000000022D473030F116dDEE9F6B43aC78BA3 across 30+ EVM chains, Permit2 unifies gasless approvals while creating a high-value phishing target.

By Dr. Devon Kurosawa, PhDReview not recorded · Updated
Uniswap Permit2 Security Audit: AllowanceTransfer vs SignatureTransfer & Witness Phishing — NFTVenue Ledger 2026 quantitative & supervisory data card
NFTVenue Ledger (EIP-712 Signatures, Permit2 Allowance Security, Royalties & Proxy Timelocks): SignatureTransfer 256-bit nonce bitmaps, mandatory Witness binding, and EOA spender blocks.Source: NFTVenue Ledger Institutional Research DeskLicense: CC-BY-4.0

Over 75% of legacy ERC-20 contracts (USDT, WETH9, BNB, LINK) predate EIP-2612 and lack native permit functions—historically forcing DEX swappers to broadcast an expensive approve(router, type(uint256).max) transaction to every new router version! Uniswap's immutable Permit2 singleton (0x000000000022D473030F116dDEE9F6B43aC78BA3) solves this permanently: once a wallet grants a one-time ERC-20 approval to Permit2, any integrated protocol—from the Uniswap v4 singleton to multi-chain DEXs in our marketplaces directory like 9mm Pro and Astroport—can request gasless EIP-712 approvals!

Yet as highlighted in our EIP-712, Permit2 & proxy security master guide, concentrating universal ERC-20 allowances inside Permit2 means a single phished off-chain PermitBatch signature lets a drainer contract sweep multiple pre-approved tokens in one transaction without the victim paying gas!

Two Distinct Modules Inside Permit2: AllowanceTransfer vs SignatureTransfer#

Auditors and institutional wallet policy engines strictly separate Permit2's two inheritance modules, which carry radically different post-signature blast radii:

  1. AllowanceTransfer (Persistent Packed uint160 Sub-Allowances): Packs (uint160 amount, uint48 expiration, uint48 nonce) into a single 256-bit storage slot per (owner, token, spender). Signing PermitSingle or PermitBatch sets a persistent allowance on Permit2 until expiration—meaning if spender is a malicious EOA or upgradeable contract, it can drain up to amount repeatedly until expiration!
  2. SignatureTransfer (Zero-Storage One-Time Execution + Unordered Bitmap Nonces): Stores zero persistent spender allowance! Instead, permitTransferFrom verifies the signature, flips 1 bit inside nonceBitmap[owner][wordPos] (256 independent parallel nonces per storage word!), transfers at most permitted.amount inside that single transaction, and permanently consumes the signature!
Permit2 SignatureTransfer unordered bitmap nonce consumption and PermitWitnessTransferFrom verification
Permit2 SignatureTransfer unordered bitmap nonce consumption and PermitWitnessTransferFrom verificationVerified Exhibit

Why Protocol Routers MUST Use permitWitnessTransferFrom!#

Suppose an aggregator router deploys swapWithPermit2(PermitTransferFrom permit, bytes sig, address recipient, uint256 minOut) using basic permitTransferFrom without a Witness! Watch the fatal Frontrun Griefing / Theft Bug:

  • Alice signs a PermitTransferFrom naming spender = AggregatorRouter for 100,000 USDC and submits swapWithPermit2(..., recipient = Alice) to the public mempool.
  • Because recipient and minOut were NOT hashed inside Alice's Permit2 signature, an MEV bot extracts Alice's (permit, sig) from the mempool and frontruns AggregatorRouter.swapWithPermit2(permit, sig, recipient = Attacker, minOut = 0)! msg.sender inside Permit2 is still AggregatorRouter, so Permit2 happily transfers Alice's 100,000 USDC and sends the output straight to the Attacker!

Mandatory Audit Rule: Any shared router or Reactor accepting user-supplied Permit2 signatures must call permitWitnessTransferFrom, passing witness = keccak256(abi.encode(ORDER_TYPEHASH, recipient, outToken, minOut, ...)) so Permit2 verifies recipient inside the user's ECDSA signature!

Security Comparison: ERC-20 approve vs EIP-2612 vs Permit2 Modes#

Quantitative Distribution · Works on Legacy USDT / WETH?
Works on Legacy USDT / WETH?Post-Swap Lingering Risk
01EIP-2612 permitNo (~25% of tok…02Permit2 AllowanceTransfer100% ERC-20s (p…03Permit2 WitnessTransfer100% ERC-20s (p…
Approval MechanismWorks on Legacy USDT / WETH?Post-Swap Lingering RiskFrontrun Parameter BindingEmergency Revocation
Legacy ERC-20 approve(MAX)Yes (Requires separate gas tx)100% Balance foreverNonePer-token approve(spender, 0)
EIP-2612 `permit`No (~25% of tokens supported)High if value = MAX signedNone (Spender not bound to order!)Per-token approve(spender, 0)
Permit2 AllowanceTransfer100% ERC-20s (post 1x setup)Bounded by uint48 expirationSpender-only (Dangerous if EOA!)1-tx Permit2.lockdown
Permit2 WitnessTransfer100% ERC-20s (post 1x setup)0.00% (Consumed instantly)100% Cryptographically Bound!invalidateUnorderedNonces
Phishing risk score and gas cost across ERC-20 approve, AllowanceTransfer, and Witness SignatureTransfer
Phishing risk score and gas cost across ERC-20 approve, AllowanceTransfer, and Witness SignatureTransferVerified Exhibit

Bitwise Unordered Nonce Bitmap Math & lockdown Recovery#

How does Permit2 pack 256 independent nonces into a single storage slot so a user can sign 10 open limit orders concurrently without sequential head-of-line blocking?

Formula or model from the articleNot independently verified
Permit2 256-Bit Unordered Nonce Splitting & Atomic Bit-Flip Verification:
  • Given uint256 nonce:
  • wordPos = uint248(nonce >> 8) [Upper 248 bits select storage mapping key]
  • bitPos = uint8(nonce & 0xff) [Lower 8 bits select bit index 0..255 inside word]
  • bitMask = (1 << bitPos)
  • Atomic Replay Check + Update (1 Cold/Warm SSTORE):
  • oldWord = nonceBitmap[owner][wordPos]
  • flipped = oldWord ^ bitMask [XOR toggles target bit]
  • require(flipped & bitMask != 0, "InvalidNonce") [Reverts if bit was ALREADY 1!]
  • nonceBitmap[owner][wordPos] = flipped
  • Worked Wallet Incident Response (User suspects 5 open off-chain limit signatures leaked on Word 0):
  • Instead of 5 separate cancel transactions, user calls Permit2.invalidateUnorderedNonces(0, type(uint256).max)
  • => Sets all 256 bits of Word 0 to 1 in ONE ~24,500-gas tx (plus lockdown([TokenSpenderPair]) to zero AllowanceTransfer)!

Wallet Firewalls Against Permit2 Phishing Kits (Inferno / Pink Drainer)#

Modern institutional wallets and browser extensions block 99% of Permit2 drainer kits by checking eth_getCode(spender): legitimate DeFi protocols never set an Externally Owned Account (EOA, code.length == 0) as Permit2.spender! Compare classic ERC-20 permit quirks next in EIP-2612 deadline & ecrecover malleability risks and EIP-712 domain replay defenses inside our EIP-712, Permit2 & Proxy Security hub.

Frequently asked questions

Why do crypto drainer kits target Permit2 signatures so heavily?

Millions of wallets have already granted unlimited ERC-20 approvals to the canonical Permit2 contract; tricking a victim into signing one free off-chain PermitBatch message lets the attacker sweep up to dozens of tokens in one tx.

What happens if a DEX router uses permitTransferFrom without a witness struct?

Plain permitTransferFrom only checks that msg.sender matches the signed router address—not who called the router! Anyone watching the mempool can extract the signature and call the router first with their own recipient address.

How do unordered nonces in Permit2 differ from EIP-2612 sequential nonces?

EIP-2612 increments nonces sequentially (0, 1, 2), so canceling or filling order #2 fails until #0 and #1 execute; Permit2 splits uint256 into a 248-bit word index and 8-bit flag, allowing 256 independent concurrent orders per slot.

How do I revoke compromised Permit2 sub-allowances in an emergency?

Call Permit2.lockdown(TokenSpenderPair) directly on 0x000000000022D473030F116dDEE9F6B43aC78BA3 to instantly zero out compromised AllowanceTransfer spenders, or revoke the underlying ERC-20 approval to Permit2.

Publication record

Published
November 13, 2026
Updated
November 14, 2026
Author
Dr. Devon Kurosawa, PhD
Review
Review not recorded
Automated fact check
Passed in the stored pipeline record
Source URLs
3 recorded

AI assistance recorded: anthropic/claude-opus-4.6. This field does not establish human review or source verification.

Academic & Institutional Attribution

Cite This Research & Embed Live Data Card

Open Attribution License (CC BY 4.0)

Standard academic & institutional research paper citation format.

Dr. Devon Kurosawa, PhD. (2026, November 14). Uniswap Permit2 Security Audit: AllowanceTransfer vs SignatureTransfer & Witness Phishing. NFTVenue Ledger. https://nftvenueledger.com/protocols/uniswap-permit2-allowance-transfer-witness-phishing-audits

Regulatory Directory Cross-Reference

Referenced Institutions & Regulatory Registries

Primary Tier-1 Supervisory Registries

Explore Erc721 Erc1155 Eip712 Permit Security Hub (20) →

NFTVenue Ledger Data, Benchmarks & Contributor Records

Uniswap Permit2 Security: Allowance vs SignatureTransfer | NFTVenue Ledger