# Uniswap Permit2 Security: Allowance vs SignatureTransfer

> Contrast Permit2 AllowanceTransfer persistent uint160 approvals against one-time SignatureTransfer unordered nonces and PermitWitnessTransferFrom phishing.

Canonical: https://nftvenueledger.com/protocols/uniswap-permit2-allowance-transfer-witness-phishing-audits
Last updated: 2026-11-14T19:39:55.976Z

**Publication:** NFTVenue Ledger
**Category:** Erc721 Erc1155 Eip712 Permit Security
**Published:** 2026-11-14T00:50:25.915Z
**Author:** Dr. Devon Kurosawa, PhD (PhD in Distributed Systems & Cryptographic Protocol Verification)
**Reviewer:** Not recorded

## Answer-first summary

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

## Key takeaways

- Permit2 splits into AllowanceTransfer (persistent time-bounded uint160 sub-allowances) and SignatureTransfer (zero-storage one-time execution with 256-bit unordered nonce bitmaps).
- Shared DEX routers and intent Reactors MUST use permitWitnessTransferFrom—never plain permitTransferFrom—or mempool frontrunners can hijack the user signature and redirect swap outputs.
- Wallet security engines flag any Permit2 signature where spender has zero bytecode (EOA) or unverified fresh deployment age as critical phishing.
- Permit2 exposes emergency lockdown to zero multiple persistent AllowanceTransfer spenders in one transaction and invalidateUnorderedNonces to burn 256 open signatures at once.

## Related financial entities

- **EIP-712 Typed Structured Data Standard** (EIP-712) — product: Standard for hashing and signing of typed structured data as opposed to just arbitrary byte strings, providing human-readable authorization.
- **Uniswap v4 Singleton & Hook Architecture** (UNI-V4) — product: Fourth-generation decentralized exchange protocol featuring a unified singleton contract and modular hooks that customize pool execution logic.

## Analysis

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](/tokens/uniswap-v4-singleton-architecture) to multi-chain DEXs in our [marketplaces directory](/marketplaces) like [9mm Pro](/marketplaces/9mm-pro) and [Astroport](/marketplaces/astroport)—can request gasless [EIP-712](/tokens/eip-712-typed-signature-standard) approvals!

Yet as highlighted in our [EIP-712, Permit2 & proxy security master guide](/protocols/eip712-permit2-erc721-royalty-proxy-timelock-security-2026), 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](/api/figure?type=flow&title=Permit2%20Witness-Bound%20SignatureTransfer%20Flow&subtitle=Cryptographically%20binding%20token%20release%20to%20exact%20swap%20order%20parameters%20with%20zero%20persistent%20allowance&steps=1.%20Witness%20Hash%3A%3AHash%20SwapOrder%28recipient%2C%20minOut%2C%20deadline%29%20into%20EIP-712%20digest%7C2.%20Caller%20Check%3A%3APermit2%20enforces%20msg.sender%20%3D%3D%20signedPayload.spender%20%28Router%2FReactor%29%7C3.%20Bitmap%20Nonce%20Flip%3A%3AXOR%201%20bit%20in%20nonceBitmap%5Buser%5D%5Bnonce%20%3E%3E%208%5D%20to%20block%20replay%7C4.%20Exact%20Pull%20%2B%20Check%3A%3ATransfer%20%3C%3D%20permitted.amount%3B%20Router%20verifies%20minOut%20to%20user!&metrics=CANONICAL%20ADDR%3A%3A0x0000..78BA3%3A%3ADeterministic%20CREATE2%20across%20EVM%7CNONCE%20DENSITY%3A%3A256%20%2F%20Slot%3A%3AUnordered%20uint256%20bitmask%20words%7CRESIDUAL%20ALLOWANCE%3A%3A0%20Tokens%3A%3ASignatureTransfer%20leaves%20zero%20approval%7CLOCKDOWN%20ESCAPE%3A%3Alockdown%28%29%3A%3AEmergency%201-tx%20bulk%20spender%20zeroing)

## 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

| Approval Mechanism | Works on Legacy USDT / WETH? | Post-Swap Lingering Risk | Frontrun Parameter Binding | Emergency Revocation |
| :--- | :--- | :--- | :--- | :--- |
| Legacy ERC-20 `approve(MAX)` | Yes (Requires separate gas tx) | **100% Balance forever** | None | Per-token `approve(spender, 0)` |
| [EIP-2612 `permit`](/protocols/eip-2612-erc20-permit-deadline-malleability-ecrecover-risks) | No (~25% of tokens supported) | High if `value = MAX` signed | None (Spender not bound to order!) | Per-token `approve(spender, 0)` |
| Permit2 `AllowanceTransfer` | **100% ERC-20s** (post 1x setup) | Bounded by `uint48 expiration` | Spender-only (Dangerous if EOA!) | **1-tx `Permit2.lockdown`** |
| **Permit2 `WitnessTransfer`** | **100% 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](/api/figure?type=bars&title=Permit2%20Integration%20Security%20%26%20Gas%20Telemetry&subtitle=Repeat-swap%20gas%20efficiency%20and%20residual%20wallet%20attack%20surface%20across%20Permit2%20primitives&steps=AllowanceTransfer%20%28EOA%20Spender%29%3A%3ACRITICAL%20PHISH%3A%20EOA%20spender%20drains%20up%20to%20uint160%20cap%20instantly!%7CSignatureTransfer%20%28No%20Witness%29%3A%3ACRITICAL%20BUG%20if%20called%20on%20shared%20router%20%28mempool%20sig%20theft!%29%7CWitnessTransfer%20%28Audited%20Router%29%3A%3AGOLD%20STANDARD%3A%200%20residual%20allowance%20%2B%20tamper-proof%20recipient%7CRepeat%20AllowanceTransfer%20Swap%3A%3ACheapest%20HFT%20repeat%20swaps%20%28~5%2C100%20gas%20warm%20uint160%20SSTORE%29&metrics=WITNESS%20OVERHEAD%3A%3A%2B~220%20Gas%3A%3AExtra%20struct%20keccak256%20hash%7CBULK%20NONCE%20CANCEL%3A%3A256%20Nonces%20%2F%20Tx%3A%3AinvalidateUnorderedNonces%28wordPos%2C%20mask%29%7CEOA%20SPENDER%20FLAG%3A%3Aextcodesize%20%3D%3D%200%3A%3AWallets%20block%20EOA%20Permit2%20spenders!%7CMAX%20EXPIRATION%3A%3A%3C%3D%2030%20Days%3A%3ARecommended%20UI%20AllowanceTransfer%20cap)

## 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
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](/protocols/eip-2612-erc20-permit-deadline-malleability-ecrecover-risks) and [EIP-712 domain replay defenses](/protocols/eip-712-domain-separator-chainid-cross-fork-replay-defense) inside our [EIP-712, Permit2 & Proxy Security hub](/topics/erc721-erc1155-eip712-permit-security).

## 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.


## Source URLs

- https://docs.uniswap.org/contracts/permit2/overview
- https://github.com/Uniswap/permit2/blob/main/src/SignatureTransfer.sol
- https://eips.ethereum.org/EIPS/eip-712

## Citation

- APA: Dr. Devon Kurosawa, PhD. (2026). Uniswap Permit2 Security Audit: AllowanceTransfer vs SignatureTransfer & Witness Phishing. NFTVenue Ledger. https://nftvenueledger.com/protocols/uniswap-permit2-allowance-transfer-witness-phishing-audits
- Canonical article: [Uniswap Permit2 Security Audit: AllowanceTransfer vs SignatureTransfer & Witness Phishing](https://nftvenueledger.com/protocols/uniswap-permit2-allowance-transfer-witness-phishing-audits)
- Site research index: [NFTVenue Ledger](https://nftvenueledger.com/llms-full.txt)
