From a2448c5f830d9ee908e4ba449ad146734036fdf9 Mon Sep 17 00:00:00 2001 From: bguillaumat Date: Wed, 25 Jan 2023 17:26:41 +0100 Subject: [PATCH] fix(execute_instruction): SQU-681 Prevent execute_instruction for auth 0 --- programs/squads-mpl/src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/programs/squads-mpl/src/lib.rs b/programs/squads-mpl/src/lib.rs index 1ef8a31..c71a134 100644 --- a/programs/squads-mpl/src/lib.rs +++ b/programs/squads-mpl/src/lib.rs @@ -443,7 +443,12 @@ pub mod squads_mpl { let ms_key = &ctx.accounts.multisig.key(); let ms_ix = &mut ctx.accounts.instruction; let tx = &mut ctx.accounts.transaction; - + + // To prevent potential failure with the Squad account auth 0 can't be executed in a specific instruction + if tx.authority_index == 0 { + return err!(MsError::InvalidAuthorityIndex); + } + // setup the authority seeds let authority_seeds = [ b"squad",