Bitcoin Observers' signed transactions will be rejected due to invalid sighashes
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.
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
- The Observers sign the generated Bitcoin transaction with TSS.
- 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.
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
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.