From c9aa4d48c76ed5e082af8f9faae953c62ea3ac6c Mon Sep 17 00:00:00 2001 From: Moudy Date: Thu, 2 Apr 2026 20:22:55 +0200 Subject: [PATCH] fix: add self_program_id check for public execution --- nssa/src/public_transaction/transaction.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nssa/src/public_transaction/transaction.rs b/nssa/src/public_transaction/transaction.rs index 6a27c0a4..8c46c88f 100644 --- a/nssa/src/public_transaction/transaction.rs +++ b/nssa/src/public_transaction/transaction.rs @@ -184,6 +184,12 @@ impl PublicTransaction { ); } + // Verify that the program output's self_program_id matches the expected program ID. + ensure!( + program_output.self_program_id == chained_call.program_id, + NssaError::InvalidProgramBehavior + ); + // Verify execution corresponds to a well-behaved program. // See the # Programs section for the definition of the `validate_execution` method. ensure!(