OVC clear stale outputs from new_outputs
What changed, and why it matters
This firmware update fixes a cleanup issue in the COLDCARD wallet's transaction signing code. Before finalizing a new Bitcoin transaction, the device now clears out leftover 'change output' records that may have been captured during a previous signing attempt that failed or was aborted. If stale records remained, they could potentially confuse the wallet's checks about where money is going, which in rare cases might affect user-facing warnings or transaction validation.
Apply the patch. For defense in depth, review other signing paths to ensure ephemeral state such as captured outputs, witnesses, and partial signatures are reset at the start of each finalize/signing attempt. Consider adding regression tests for aborted-then-retried signing flows.
Security signals we found
State not reset between signing attempts
Stale change-output metadata reused in transaction finalization
OVC (Output Value Check) validation may be affected by leftover data
Evidence from the diff
In shared/psbt.py, the finalize() method now calls history.new_outpts.clear() before writing the transaction version. The new_outputs/new_outpts list captures change outputs during OVC (Output Value Check) signing. A previously failed or partial signing could leave entries in this list. Without clearing them, subsequent finalization might operate on stale output state, potentially causing incorrect change-output validation or misleading security checks during PSBT finalization.
Changed components
shared/psbt.pyPSBT.finalize()OVC change-output tracking (history.new_outpts)Inspect captured patch +3 / −0
### shared/psbt.py
@@ -2581,6 +2581,9 @@ def finalize(self, fd):
# - but in segwit case, needs to re-read to calculate it
# - fd must be read/write and seekable to support txid calc
+ # drop any stale change captures from a previously-failed signing
+ history.new_outpts.clear()
+
fd.write(pack('<i', self.txn_version)) # nVersion
# does this txn require witness data to be included?Why this scored 41/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.