What changed, and why it matters
This commit fixes a small bug in the COLDCARD's built-in self-test for the MicroSD card slot. The test was accidentally using the wrong value returned by a helper function, which meant the self-test could fail or behave incorrectly even though the hardware was fine. It is a routine bugfix in factory diagnostics, not a security vulnerability that attackers can exploit.
No security action required. Treat as a normal quality fix; include in the next firmware release if desired.
Security signals we found
No security-relevant signals present
Routine diagnostic bugfix with no attacker-controlled input path
No memory safety, cryptographic, or authorization changes
Evidence from the diff
In shared/selftest.py, the test_microsd() function called card.pick_filename(‘test-delme.txt’) and unpacked the result as _, fn = .... The function actually returns (filename, extension), so the correct unpack is fn, _ = .... The old code assigned the extension to fn and discarded the real filename, causing the subsequent open(fn, 'wt') to use an empty or wrong string. This only affects the device’s self-test routine and is corrected by swapping the tuple unpack order.
Changed components
shared/selftest.pyMicroSD self-test routineInspect captured patch +2 / −1
diff --git a/releases/Next-ChangeLog.md b/releases/Next-ChangeLog.md
index f0959b6..9077e13 100644
--- a/releases/Next-ChangeLog.md
+++ b/releases/Next-ChangeLog.md
@@ -11,6 +11,7 @@ This lists the new changes that have not yet been published in a normal release.
- Bugfix: If all change outputs have `nValue=0` they were not shown in UX.
- Bugfix: Disallow negative input/output amounts in PSBT.
- Bugfix: Fix filesystem initialization after Wife LFS or Destroy Seed.
+- Bugfix: Fix MicroSD selftest
## Spending Policy Feature
diff --git a/shared/selftest.py b/shared/selftest.py
index 637e3fb..4550b17 100644
--- a/shared/selftest.py
+++ b/shared/selftest.py
@@ -364,7 +364,7 @@ async def test_microsd():
with CardSlot(slot_b=slot_num) as card:
- _, fn = card.pick_filename('test-delme.txt')
+ fn, _ = card.pick_filename('test-delme.txt')
with open(fn, 'wt') as fd:
fd.write("Hello")
Why this scored 18/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.