Skip to content
Crypto Audit finding Advanced

Bitcoin Observers' signed transactions will be rejected due to invalid sighashes

g Follow

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2025-04-zetachain-cross-chain-judging/issues/424

Found by

g

Summary

The Bitcoin Observers use invalid sighashes when generating the witness hash for each transaction input. The Bitcoin network will reject all the signed transactions by the Observers.

Root Cause

In SignTx(), an empty byteslice and zero amount are used when generating the sighashes.

GOLANG
sigHashes := txscript.NewTxSigHashes(tx, txscript.NewCannedPrevOutputFetcher([]byte{}, 0))

The correct input is the previous output's scriptPubKey and amount.

Internal Pre-conditions

None

External Pre-conditions

None

Attack Path

  1. The Observers sign the generated Bitcoin transaction with TSS.
  2. When the transaction is broadcast, the Bitcoin network rejects it because it fails verification since the sighash it reconstructs using the actual previous outputs' script and amount does not match the sighash created by the Observers.

Impact

All the withdrawal transactions in the Bitcoin network will fail. Users will be unable to withdraw from the Bitcoin network.

PoC

No response

Mitigation

Consider generating the correct sighashes with the below pseudocode.

GOLANG
prevOutFetcher := txscript.NewMultiPrevOutFetcher(nil)
for i, input := range tx.TxIn {
	prevOut := selected.UTXOs[i]  // Get the corresponding UTXO
	script, err := hex.DecodeString(prevOut.ScriptPubKey)
	if err != nil {
		return nil, err
	}
	amount := int64(prevOut.Amount * btcutil.SatoshiPerBitcoin)
	prevOutFetcher.AddPrevOut(input.PreviousOutPoint, &wire.TxOut{
		Value:    amount,
		PkScript: script,
	})
}
sigHashes := txscript.NewTxSigHashes(tx, prevOutFetcher)
sigHashes := txscript.NewTxSigHashes(tx, txscript.NewCanned

The original report as published on Sherlock, by g. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is known

A medium-severity crypto bug in ZetaChain Cross-Chain. Sherlock made it public on 28 May 2025. Found in the 857 audit contest (finding M-38).

About Crypto

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is Crypto?

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.

More by g

View all

23 more disclosed reports, best first.

More from ZetaChain Cross-Chain

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cryptographic weaknesses

The lesson behind this report.

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.