From 1f9fd4a4227bb9593fa838f9b59f4bf482169d9e Mon Sep 17 00:00:00 2001 From: ffulb Date: Fri, 3 Apr 2026 06:00:28 +0000 Subject: [PATCH] fix: use is_signer instead of is_writable for readonly accounts in transfer hook In transfer_checked_with_transfer_hook, the readonly account branch passes account_info.is_writable as the is_signer parameter to AccountMeta::new_readonly(). Since readonly accounts have is_writable=false, this forces all readonly accounts to is_signer=false, silently stripping signer requirements from transfer hook additional accounts. This could allow unauthorized transfers through Token-2022 mints with transfer hooks that require a readonly signer account. --- programs/drift/src/controller/token.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/drift/src/controller/token.rs b/programs/drift/src/controller/token.rs index a36a2e8404..1b0d705338 100644 --- a/programs/drift/src/controller/token.rs +++ b/programs/drift/src/controller/token.rs @@ -266,7 +266,7 @@ pub fn transfer_checked_with_transfer_hook<'info>( ix.accounts.push(if account_info.is_writable { AccountMeta::new(*account_info.key, account_info.is_signer) } else { - AccountMeta::new_readonly(*account_info.key, account_info.is_writable) + AccountMeta::new_readonly(*account_info.key, account_info.is_signer) }); account_infos.push(account_info.to_account_info()); }