Share on XShare on LinkedInShare on Telegram
Security Decisions/ Before launchWeb3 Security

Understanding Token-2022 Transfer Hook Security Risks

Token-2022 transfer hooks let mint creators run code inside your Solana program’s transfers, reopening reentrancy and account-spoofing risks. This Token-2022 audit checklist covers mint-scoped ExtraAccountMetaList PDAs, CPI Guard self-delegation bypasses, permanent delegates, mint close authority, and confidential transfer auditor keys, so you can verify every extension before mainnet.

Author
QuillAudits Team
•October 15, 2026
Understanding Token-2022 Transfer Hook Security Risks
Share on XShare on LinkedInShare on Telegram

The decision · answer in brief

Token-2022 transfer hooks let mint creators run code inside your Solana program’s transfers, reopening reentrancy and account-spoofing risks. This Token-2022 audit checklist covers mint-scoped ExtraAccountMetaList PDAs, CPI Guard self-delegation bypasses, permanent delegates, mint close authority, and confidential transfer auditor keys, so you can verify every extension before mainnet.

A Token-2022 audit checklist has to cover ground the original SPL Token program never needed: transfer hooks, CPI Guard, confidential transfers, permanent delegates, and mint close authority all introduce behavior that executes outside your program's direct control. This guide maps each extension to the specific pre-mainnet check it needs, anchored in the vulnerability classes researchers have already found rather than generic EVM audit advice ported over to Solana.

If you've audited EVM contracts, you already know how to think about reentrancy and access control. What you may not expect is that Solana, long pitched as structurally immune to callback-based reentrancy, now has a standard extension that reopens that exact attack surface. That's the context this checklist works from.

What Is Token-2022 and Why Do Transfer Hooks Matter?

Token-2022, also called Token Extensions, is the successor to the original SPL Token program on Solana. It keeps the same core token mechanics but adds opt-in extensions at the mint or account level: transfer fees, confidential transfers, permanent delegates, default account states, mint close authority, and transfer hooks, among others.

The transfer hook extension is the one that changes the security model the most. It lets a mint attach a program that runs automatically on every transfer of that token, with the logic defined by whoever created the mint rather than by whoever is doing the transferring. According to the Transfer Hook Interface documentation, this is what makes use cases like on-chain royalty enforcement, transfer allowlists, and compliance checks possible without forking the token program itself.

That flexibility is also the risk. A protocol that calls transfer_checked on a Token-2022 mint it does not control has no guarantee about what code runs during that call. It could be a royalty check. It could be something designed to probe the calling program's accounts.

How Transfer Hooks Differ From the Original SPL Token Program

The original SPL Token program has no hook points. A transfer either succeeds according to fixed program logic or it fails; nothing else executes. Token-2022 changes that contract in three concrete ways:

  • External code executes mid-transfer. The hook program runs as a cross-program invocation, or CPI, during the transfer instruction itself, not before or after it.
  • The mint, not the caller, chooses the code. Whoever initializes the mint sets the hook program address, so a caller integrating a new Token-2022 mint is trusting code they did not write and may not have reviewed.
  • Account discovery becomes part of the attack surface. The hook needs extra accounts beyond the standard transfer accounts, resolved through a structure called ExtraAccountMetaList, which itself has to be validated.

This is the structural shift founders need to budget audit time for. A standard ERC-20-style token audit checklist (QuillAudits' ERC-20 token contract audit checklist covers that model) does not map cleanly onto a token standard where transfer logic can branch into arbitrary external code.

How Do Transfer Hooks Reintroduce Callback-Based Vulnerabilities?

Transfer hooks hand control of part of the transfer path to code the receiving protocol didn't write, which is precisely the condition that produces reentrancy and context-confusion bugs on other chains. The two classes to check for are reentrancy through hook-triggered CPIs, and CPI account spoofing where a hook or its invoker supplies accounts the receiving program trusts without verifying.

Reentrancy - Why Solana Was Considered Immune, and Why That Changed

Solana's runtime has historically been described as reentrancy-resistant because of how it validates account ownership and restricts cross-program calls compared to the EVM's more permissive call semantics. Token-2022 transfer hooks undo part of that assumption. As security firm Neodyme explains, "a DeFi protocol calling transfer_checked can end up executing code written by whoever created the token," because the hook program is specified by the token creator, not the caller.

That single sentence is worth sitting with if you're building a lending market, AMM, or vault that accepts arbitrary Token-2022 mints as collateral or liquidity. Every transfer_checked call to an unvetted mint is effectively an invitation for that mint's hook to execute inside your transaction.

Zealynx's 2026 Solana audit guide frames the concrete failure mode: if a transfer hook triggers a CPI that initiates another transfer of the same mint, it creates a recursion loop. The Solana runtime eventually halts it, but by then it has already served as a griefing vector that can freeze assets mid-transaction.

CPI Account Spoofing and Context Confusion

The second failure mode is subtler than reentrancy: a hook program trusting accounts it was handed without confirming who handed them over, or without confirming the calling context is legitimate. Neodyme's audit work found that transfer hook programs can be invoked by any mint; without restricting which mints a hook program supports, an attacker can call your hook from their own mint and potentially access your program's PDAs, or program-derived addresses.

In practice this means a hook program written for Mint A can be invoked by an attacker who creates Mint B, points it at the same hook program, and crafts a transfer that causes the hook to touch Mint A's program-owned accounts using Mint B's transfer as the trigger. If the hook doesn't check which mint is actually calling it, that context confusion becomes an account-access bug.

Zealynx's guide states the underlying principle plainly: "Failure to strictly validate these seeds allows attackers to inject malicious accounts (e.g., a spoofed whitelist) to bypass transfer logic." Every PDA a hook touches has to be derived and checked against the specific mint invoking it, not assumed from the instruction's account list.

This pattern isn't unique to Solana. Transfer hooks give the same underlying mistake, unvalidated trust in transfer-path logic, a new and more flexible place to hide on Solana.

What Goes Wrong With ExtraAccountMetaList Validation?

ExtraAccountMetaList is the account that tells callers which additional accounts a transfer hook needs beyond the standard mint, source, and destination accounts. Most ExtraAccountMetaList failures come down to one root cause: the structure resolves to a program-derived address, but if that PDA isn't scoped to the specific mint being transferred, nothing stops an attacker from substituting their own accounts for whatever the hook expects to receive.

The Mint-Scoped PDA Fix

The fix auditors should verify is in place before mainnet:

  1. Derive the ExtraAccountMetaList PDA from the mint address, not from a program-wide constant or a caller-supplied seed.
  2. Confirm the hook program checks the mint on every invocation, rejecting transfers where the mint does not match the one the hook was configured for.
  3. Validate every extra account returned by the list against expected ownership and discriminator checks inside the hook itself, rather than trusting that ExtraAccountMetaList resolution alone guarantees safety.
  4. Reject CPI-sourced invocations the hook was not designed to handle, if the hook's threat model requires the transfer to originate from a direct instruction rather than a nested call.
  5. Test with a second, attacker-controlled mint pointed at the same hook program to confirm it cannot be tricked into acting on accounts it does not own.

Mint-scoping the PDA closes the specific hole Neodyme flagged: a hook that only checks "is this account owned by the expected program" without checking "is this transfer actually for the mint I was built for" will happily process a transfer from any mint that routes through it.

A quick way to see the gap during review is to diff the two versions of the check side by side. The vulnerable version only confirms account ownership:

1// Vulnerable: confirms the account belongs to this program,
2// but never checks which mint is actually transferring
3fn validate_extra_account(account: &AccountInfo, expected_program: &Pubkey) -> Result<()> {
4    require!(account.owner == expected_program, HookError::InvalidOwner);
5    Ok(())
6}
7

The fixed version adds the mint-scoping step before anything else runs:

1// Fixed: derives the PDA from the specific mint being transferred
2// and rejects anything that doesn't match
3fn validate_extra_account(account: &AccountInfo, mint: &Pubkey, expected_program: &Pubkey) -> Result<()> {
4    let (expected_pda, _bump) = Pubkey::find_program_address(
5        &[b"extra-account-metas", mint.as_ref()],
6        expected_program,
7    );
8    require!(account.key == &expected_pda, HookError::MintMismatch);
9    require!(account.owner == expected_program, HookError::InvalidOwner);
10    Ok(())
11}
12

Running a transfer from a second, attacker-controlled mint against the vulnerable version is the fastest way to prove the gap in practice: the account passes the ownership check and the hook processes it anyway, because nothing ever asked which mint triggered the call in the first place.

Recursion Loops as a Griefing Vector

Beyond spoofing, auditors need to trace what happens when a hook's own CPI triggers another transfer of the same mint. Zealynx's guidance is to require mathematical proof that transfer hooks cannot form infinite loops as part of a 2026-level audit, alongside CPI Guard enabled on program-controlled vaults and ImmutableOwner enabled to prevent account hijacking.

Even though the runtime caps CPI depth and will eventually abort a true infinite loop, the practical damage happens before the abort: a transaction that reliably fails because a hook recurses into itself means any program depending on that mint for a time-sensitive operation (liquidation, settlement, an oracle update) can have those transfers reliably griefed. Treat "can this hook cause a self-referential transfer" as a yes/no gate, not a performance concern.

Token-2022 Audit Checklist Item: What Other Extensions Carry Post-Deploy Risk?

Transfer hooks get the most attention, but four other extensions carry risk that a checklist focused only on hooks will miss: CPI Guard, default account state and mint close authority, permanent delegate, and confidential transfers. Each needs its own specific check.

CPI Guard and the Self-Delegation Bypass

CPI Guard is meant to block a token account from being manipulated through a cross-program invocation the account owner didn't directly authorize, closing off a class of drainer attacks where a malicious program calls transfer or approve on a victim's behalf inside someone else's transaction. The protection has a documented gap: Neodyme found that the CPI Guard lock is disabled when a transfer is called as a delegate, and an account can be delegated to itself, which unintentionally disables the CPI lock entirely.

That means an attacker doesn't need to compromise CPI Guard directly. They only need to get a victim account delegated to itself, intentionally or through a confusing approval flow, to switch off a protection the user believes is still active. Audit checklist item: confirm the integration never allows a self-delegation path, and confirm CPI Guard status is checked at the point of transfer, not just at account creation.

There's a second tradeoff worth flagging here, not a fix: Neodyme also notes that verifying the caller is the Token-2022 program itself (via get_instruction_relative) to block CPI-based calls to a hook also blocks legitimate transfers that happen to occur within a CPI. That's a case-by-case judgment call for auditors, not a universal rule, since some legitimate integrations (aggregators, routers) need to call transfer from within their own CPI chain.

Default Account State, Mint Close Authority, and Permanent Delegate

Three extensions deserve a line each in any Token-2022 audit checklist because they each grant a kind of control that doesn't exist in the base SPL Token program:

  • Default account state lets a mint force new token accounts to start frozen, useful for KYC-gated tokens, but it only works if every downstream integration actually checks frozen status before assuming a balance is usable.
  • Mint close authority lets a mint be closed and, per Neodyme's research, reinitialized at the same address, leaving orphaned token accounts behind that can bypass KYC restrictions, evade transfer fees, or violate the intent of a soulbound token design if the integration assumes a mint address is a permanent, stable identity.
  • Permanent delegate grants a designated authority unlimited access to move tokens out of any account for that mint. Neodyme's assessment is direct: this extension can drain vault-style protocols entirely if misconfigured or over-trusted. Any protocol accepting a Token-2022 mint as collateral needs to check whether a permanent delegate is set, and if so, who controls it and under what multisig or timelock.

Closing a Token-2022 account correctly is its own checklist item. Every active extension's closure condition has to independently pass, as Offside Security's Token-2022 write-up details: CPI Guard requires the destination be the token owner, Transfer Fee requires the withheld amount to equal zero, and Confidential Transfer requires both pending and available balances to be zero. If a developer hardcodes rent and space values instead of calling getExtensionTypes() and getMinimumBalanceForRentExemptAccountWithExtensions(), account creation will break the moment a mint adds an extension the original code didn't account for, since Token-2022 account space is not fixed per Offside's guidance.

Confidential Transfers and the Auditor Key

Confidential transfers use zero-knowledge proofs to hide transfer amounts on-chain while still allowing the network to validate that a transfer is well-formed. Zealynx's 2026 audit guidance includes a specific compliance check here: verify the Auditor Key is set to [0; 32] (all zero bytes); otherwise the protocol carries an undisclosed compliance backdoor whose custody needs to be audited, since a non-zero auditor key means some party can decrypt transfer amounts that users believe are confidential.

The cryptography underneath confidential transfers has also had a real, patched failure. A bug in the ZK ElGamal Proof program, the component confidential transfers rely on, stemmed from missing algebraic components in the Fiat-Shamir Transformation, which could have allowed forged proofs. CoinDesk reported that the Solana Foundation said it found no evidence of exploitation or fund loss before the bug was quietly patched. The incident is a reminder that confidential transfer security depends on a shared cryptographic library most teams never audit themselves, and an audit checklist should at minimum confirm the deployed program version postdates the fix.

Token-2022 Audit Checklist Before Mainnet

Pull the extension-specific checks above into a single pre-mainnet pass:

ExtensionWhat to verify
Transfer hookExtraAccountMetaList PDA is mint-scoped; hook checks the invoking mint on every call
Transfer hookNo recursive CPI path lets a hook trigger another transfer of the same mint
Transfer hookDecision on whether to block CPI-originated hook calls is deliberate, not accidental
CPI GuardNo self-delegation path exists that would silently disable the CPI lock
Default account stateEvery integration checks frozen status before treating a balance as spendable
Mint close authorityIntegration treats a closed-and-reopened mint address as untrusted, not as the same token
Permanent delegatePresence and custody of a permanent delegate is disclosed and reviewed before accepting the mint as collateral
Confidential transfersAuditor key is [0; 32], or any non-zero key and its holder are disclosed
Account closureEach active extension's independent close condition is satisfied, not just the base account
Account sizingSpace and rent are computed via getExtensionTypes() and getMinimumBalanceForRentExemptAccountWithExtensions(), never hardcoded

This narrows down from the broader groundwork covered in a general smart contract audit readiness checklist, and it pairs with extension-aware checks the same way a token vesting and lockup contract audit pairs with a base token audit; both narrow a general framework down to a specific contract type. Teams managing admin keys or multisig custody around any of these extensions, particularly permanent delegate and mint close authority, should also run them through the kind of operational review laid out in the admin audit checklist.

Token-2022 is also the standard increasingly chosen for stablecoins and tokenized real-world assets, where transfer restrictions and compliance hooks are often the entire point of using it; see QuillAudits' coverage of RWA security risks and practices for the broader context on why that adoption curve raises the stakes on getting these checks right, and the security token background explainer if the tokenization model itself is new ground.

Final Thoughts

Treat transfer hooks as Solana's version of a reentrancy guard requirement: not every mint needs one, but every integration needs to assume one might be there. Map each extension your protocol accepts to the checklist above before mainnet, not after, since several of these failure modes (a self-delegated CPI Guard bypass, a reinitialized mint address, an unscoped ExtraAccountMetaList PDA) only surface once real capital is already flowing through the integration.

Checking all of this manually against a specific program's PDA derivations and CPI paths is exactly where a written checklist runs out of road and a manual review takes over.

Explore more Security Decisions

Contents

Tell Us About Your Project
Subscribe to Newsletter
hashing bits image
Loading...
Loading...

WE SECURE EVERYTHING YOU BUILD.

From day-zero risk mapping to exchange-ready audits, QuillAudits helps projects grow with confidence. Smart contracts, dApps, infrastructure, compliance: secured end to end.

QuillAudits Logo


ISO 27001Circle Alliance Program
Uniswap FoundationAethiropt-collectivePolygon SPNBNB Chain Kickstart

All Rights Reserved. © 2026. QuillAudits - LLC