Skip to content

Commit

Permalink
fix: don't just execute arbitrary approved instructions
Browse files Browse the repository at this point in the history
Signed-off-by: Shunkichi Sato <[email protected]>
  • Loading branch information
s8sato committed Nov 4, 2024
1 parent 111cc30 commit 750b422
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions wasm/libs/default_executor/src/multisig/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,16 +240,12 @@ impl VisitExecute for MultisigApprove {
.dbg_unwrap();

if !is_expired {
// Execute instructions proposal which collected enough approvals
for isi in instructions {
match isi {
InstructionBox::Custom(instruction) => {
let mut executor = executor.clone();
executor.context_mut().authority = target_account.clone();
visit_custom(&mut executor, &instruction)
}
builtin => host.submit(&builtin).dbg_unwrap(),
}
// Validate and execute the authenticated multisig transaction
for instruction in instructions {
// Create an instance per instruction to reset the context mutation
let mut executor = executor.clone();
executor.context_mut().authority = target_account.clone();
executor.visit_instruction(&instruction)
}
} else {
// TODO Notify that the proposal has expired, while returning Ok for the entry deletion to take effect
Expand Down

0 comments on commit 750b422

Please sign in to comment.