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

bugfix: signing TOCTOU on PSRAM-staged PSBT

Public commit record

What the developer wrote

Authored by scgbckbone

78/100 · Adequate
bugfix: signing TOCTOU on PSRAM-staged PSBT

- bind SHA256 of staged bytes at parse; re-verify immediately before
signing, fail closed (wipe + "Transaction modified") on mismatch
- PSRAM write-generation counter gates the re-check: common path costs
one integer compare
- usb: reject upld with busy while a non-transaction approval flow owns
the staging area
- regression tests: mid-approval upld rewrite and direct PSRAM mutation
both abort signing; unchanged buffer still signs
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit fixes a security bug where a malicious or compromised computer connected to a COLDCARD wallet could potentially swap the transaction data after the user reviewed it on the device screen but before the device signed it. The user might approve one transaction while the device signs a different one. The fix locks down the staged transaction data, re-checks it right before signing, and aborts with an error if anything changed.

Recommended action

Treat this as a security fix and include it in the next firmware release. Users should upgrade when available. The change is defensive and fail-closed, so no configuration change is needed.

Security signals we found

01

TOCTOU vulnerability in transaction signing

02

Post-review mutation of staged PSBT bytes

03

USB host could rewrite transaction data during approval

04

Fail-closed behavior on detected modification

05

PSRAM write-generation counter for fast-path integrity check

06

Regression tests for attack scenarios

07

Acknowledged external report with PoC

Risk score

Why this scored 82/100

Our methodology →
Potential impact 28/30
Exploitability 18/25
Stealth signal 12/15
Affected reach 10/15
Confidence 9/10
Evidence quality 5/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.