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

bugfix: capture single-sig segwit change

Public commit record

What the developer wrote

Authored by scgbckbone

60/100 · Adequate
bugfix: capture single-sig segwit change
bugfix: defer OVC persistence until signing
enhancement: improve OVC implementation and size 30 -> 128
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
The short version

What changed, and why it matters

This commit fixes two related security bugs in the COLDCARD hardware wallet's protection against a known 'BIP-143 amount swap' attack. First, the wallet was recording the claimed amount of a segwit input to its secure cache as soon as a transaction was previewed, even if the user later cancelled without signing. A malicious co-signer could therefore 'poison' the cache with a wrong amount and later prevent the owner from spending that coin. Second, single-signature segwit change outputs created by transactions the user signed were not being added to the cache, so an attacker could later trick the wallet into signing a spend that understated the change amount. The patch defers cache writes until after a signature is actually produced, and captures single-sig segwit change amounts at finalize time. It also expands the cache size from 30 to 128 entries.

Recommended action

Users should install a firmware release containing this commit. Until then, be cautious about previewing untrusted PSBTs on the device, and verify change output details manually when signing single-sig segwit transactions. Wallet software that builds PSBTs for COLDCARD should ensure it provides correct witness UTXO amounts and proper change detection.

Security signals we found

01

Fixes deferred persistence of UTXO amount cache until after successful signing

02

Fixes missing capture of single-sig segwit change outputs (p2wpkh and p2sh-p2wpkh)

03

Prevents cache poisoning by cancelled/malicious PSBT previews

04

Addresses BIP-143 segwit amount-swap attack surface

05

Adds regression tests for OVC poisoning, multi-input commit, and single-sig change capture

06

Proof of Reserves explicitly excluded from reading or modifying OVC

Risk score

Why this scored 74/100

Our methodology →
Potential impact 22/30
Exploitability 16/25
Stealth signal 12/15
Affected reach 12/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.