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

bootloader: reject DFU images longer than signed firmware_length

Public commit record

What the developer wrote

Authored by scgbckbone

73/100 · Adequate
bootloader: reject DFU images longer than signed firmware_length

verify_firmware_in_ram() authenticated only hdr->firmware_length bytes,
but the untrusted DFU element length was passed unchecked to
psram_do_upgrade(), which flashed that many bytes. Anything appended
past the signed length (up to FW_MAX_LENGTH_MK4, which reaches the top
of flash and covers the whole internal /flash filesystem) was written
to flash without possessing the signing key, e.g. via recovery-mode SD
upgrade of the currently-installed signed image.

- verify_firmware_in_ram(): require len == hdr->firmware_length,
fail closed on any mismatch
- psram_do_upgrade(): assert size <= FW_MAX_LENGTH_MK4 (defense in depth)

Affects Mk4 and Q1 (shared bootloader sources).
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This fix closes a serious bug in the COLDCARD Mk4 and Q1 bootloader. Previously, when installing a firmware update from a microSD card in recovery mode, the bootloader verified only the portion of the file that the firmware header said was signed. Any extra bytes appended after that signed portion were still written to the device's flash memory, even though they were not signed. An attacker who could get a victim to install a legitimate-looking signed firmware file with malicious data tacked onto the end could overwrite parts of the device's internal storage without needing COLDCARD's signing key. The patch now rejects any update whose total length does not exactly match the signed length, and adds a hard upper-size limit as a backup safeguard.

Recommended action

Treat this as a security fix and ship it promptly. Users should upgrade their bootloader/firmware through normal signed channels. Avoid installing firmware images from untrusted sources or recovery-mode SD cards whose provenance is uncertain. Consider issuing a security advisory noting that recovery-mode SD upgrades of already-installed images could have been abused before this fix.

Security signals we found

01

Bypass of cryptographic signature verification for appended data

02

Arbitrary unsigned flash write during firmware upgrade

03

Potential overwrite of internal flash filesystem

04

Fail-closed length validation added

05

Defense-in-depth upper bound added

Risk score

Why this scored 81/100

Our methodology →
Potential impact 25/30
Exploitability 20/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.