AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Moderate 64 Bitcoin

Merge pull request #2625 from starius/port-35984

Public commit record

What the developer wrote

Authored by Olaoluwa Osuntokun

68/100 · Adequate
Merge pull request #2625 from starius/port-35984

txscript: reject SIGHASH_SINGLE signing without a matching output
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes a Bitcoin signing bug in btcd. When creating a transaction signature of type SIGHASH_SINGLE for an input whose index has no matching output, the signature would not actually commit to any output. That means the signature remains valid even if someone later changes where the money goes, as long as no output exists at that input's index. The patch now refuses to produce such signatures, preventing wallets or automated tools from accidentally creating signatures that could be reused to redirect funds.

Recommended action

Review any code that calls RawTxInSignature, RawTxInWitnessSignature, SignTxOutput, WitnessSignature, or TaprootWitnessSignature with SIGHASH_SINGLE to ensure it handles the new ErrInvalidSigHashSingleIndex error. Upgrade to a release containing this commit and avoid relying on signatures produced under the vulnerable condition, since existing such signatures could still be replayed on-chain.

Security signals we found

01

SIGHASH_SINGLE without matching output creates signature committing to no output

02

Signature remains valid if outputs are later mutated, as long as matching output remains absent

03

Could allow funds redirection by anyone holding the signature

04

Patch refuses to produce such signatures in legacy and segwit v0 ECDSA signers

05

Multisig paths skip refused signatures rather than producing them

06

New error code and tests added for the condition

Risk score

Why this scored 64/100

Our methodology →
Potential impact 22/30
Exploitability 12/25
Stealth signal 8/15
Affected reach 10/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.