diff --git a/lee/state_machine/core/src/program/mod.rs b/lee/state_machine/core/src/program/mod.rs index 08e112743..a05e58c0f 100644 --- a/lee/state_machine/core/src/program/mod.rs +++ b/lee/state_machine/core/src/program/mod.rs @@ -843,7 +843,7 @@ pub fn validate_execution( Ok(()) } -/// Logic of system-wide `Clear` instriction. +/// Logic of system-wide `Clear` instruction. /// /// Checks authorization, clearing data and assigning a new owner. pub fn validate_clear( diff --git a/lee/state_machine/src/validated_state_diff/mod.rs b/lee/state_machine/src/validated_state_diff/mod.rs index 4b35385fe..8c7140d53 100644 --- a/lee/state_machine/src/validated_state_diff/mod.rs +++ b/lee/state_machine/src/validated_state_diff/mod.rs @@ -129,6 +129,9 @@ impl ValidatedStateDiff { match instruction { SystemInstruction::Clear { new_owner } => { + // Only the `account_id` is read from `chained_call.pre_states`; the + // account and its authorization are re-derived below, so a forged + // pre_state grants nothing (cf. the audit-issue 91 note further down). for pre_state in &chained_call.pre_states { let account_id = pre_state.account_id; let pre = AccountWithMetadata::new(