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

bugfix: bind firmware upgrade approval to staged image

Public commit record

What the developer wrote

Authored by scgbckbone

83/100 · Strong
bugfix: bind firmware upgrade approval to staged image

FirmwareUpgradeRequest renders the consent screen from a header
snapshot captured at upload time, but hands the flash operation a
live PSRAM window. A second upload is permitted while the approval
is displayed (check_busy allow-lists FirmwareUpgradeRequest), and a
raw image upload without the legacy trailer never re-enters
authorize_upgrade — so the staged bytes can be replaced after review
without any error.

Record a digest of the staged image at approval time and re-verify
immediately before pa.firmware_upgrade(), failing closed on mismatch.
Mirrors the staged-bytes guard ApproveTransaction already has.

Add a regression test that uploads image A, gets the approval screen,
uploads image B as a raw image (no trailer), approves, and asserts
the upgrade aborts.
✓ Specific, 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 in the COLDCARD hardware wallet's firmware update process. Previously, while the user was looking at the approval screen for one firmware file, a second file could be silently uploaded and replace the first one. If the user approved, the second (unreviewed) firmware would be installed instead of the one they saw on screen. The fix records a fingerprint of the staged firmware at approval time and checks it again right before flashing, aborting if anything changed.

Recommended action

Apply this patch promptly; it closes a real firmware-integrity TOCTOU. Users should ensure their COLDCARD firmware includes this fix before performing future upgrades. No additional action is indicated by the commit materials.

Security signals we found

01

Time-of-check/time-of-use (TOCTOU) between consent screen and flash operation

02

Missing integrity re-verification before destructive firmware write

03

Authorization bypass via concurrent/reordered request handling

04

Regression test demonstrates staged-image replacement attack

05

Fix mirrors existing staged-bytes guard in ApproveTransaction

Risk score

Why this scored 76/100

Our methodology →
Potential impact 22/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.