#38392 [BC-High] Signer can steal STX tokens in multi-sign wallet by setting a high stacks tx fee
Description
Brief/Intro
Vulnerability Details
async fn handle_stacks_transaction_sign_request(
&mut self,
request: &StacksTransactionSignRequest,
bitcoin_chain_tip: &model::BitcoinBlockHash,
origin_public_key: &PublicKey,
) -> Result<(), Error> {
let instant = std::time::Instant::now();
let validation_status = self
.assert_valid_stacks_tx_sign_request(request, bitcoin_chain_tip, origin_public_key)
.await;
metrics::histogram!(
Metrics::ValidationDurationSeconds,
"blockchain" => STACKS_BLOCKCHAIN,
"kind" => request.tx_kind(),
)
.record(instant.elapsed());
metrics::counter!(
Metrics::SignRequestsTotal,
"blockchain" => STACKS_BLOCKCHAIN,
"kind" => request.tx_kind(),
"status" => if validation_status.is_ok() { "success" } else { "failed" },
)
.increment(1);
validation_status?;
// We need to set the nonce in order to get the exact transaction
// that we need to sign.
let wallet = SignerWallet::load(&self.context, bitcoin_chain_tip).await?;
wallet.set_nonce(request.nonce);
let multi_sig = MultisigTx::new_tx(&request.contract_tx, &wallet, request.tx_fee);
let txid = multi_sig.tx().txid();
debug_assert_eq!(txid, request.txid);
let signature = crate::signature::sign_stacks_tx(multi_sig.tx(), &self.signer_private_key);
let msg = message::StacksTransactionSignature { txid, signature };
self.send_message(msg, bitcoin_chain_tip).await?;
Ok(())
}Impact Details
References
Proof of Concept
Proof of Concept
Previous#38671 [BC-Insight] Signer key rotation is not possible due to deadlock between submitting key rotatNext#37861 [BC-Critical] SBTC Signer WSTS implementation allows nonce replays such that a malicious sign
Last updated
Was this helpful?