#43307 [BC-High] Not verifying the signatures upon execution leads to direct loss of funds
Description
Brief/Intro
Vulnerability Details
async fn execute_block(
&mut self,
block: Block,
block_timestamp: u64,
) -> anyhow::Result<BlockCommitment> {
let block_id = block.id();
let block_hash = HashValue::from_slice(block.id())?;
// get the transactions
let mut block_transactions = Vec::new();
let block_metadata = self.executor.build_block_metadata(
HashValue::sha3_256_of(block_id.as_bytes().as_slice()),
block_timestamp,
)?;
let block_metadata_transaction =
SignatureVerifiedTransaction::Valid(Transaction::BlockMetadata(block_metadata));
block_transactions.push(block_metadata_transaction);
for transaction in block.transactions() {
let signed_transaction: SignedTransaction = bcs::from_bytes(transaction.data())?;
// check if the transaction has already been executed to prevent replays
if self
.executor
.has_executed_transaction_opt(signed_transaction.committed_hash())?
{
continue;
}
@> let signature_verified_transaction = SignatureVerifiedTransaction::Valid(
Transaction::UserTransaction(signed_transaction),
);
block_transactions.push(signature_verified_transaction);
}
// ..
}Impact Details
References
Proof of Concept
Proof of Concept
Previous#43303 [BC-Medium] The call to `commit_transaction()` includes the wrong sequence numberNext#43312 [BC-Medium] get_state_proof() is called with the current version leading to the epoch_changes of the StateProof always being empty
Was this helpful?