Skip to content

Security audit fixes for B13 - #471

Merged
3rdIteration merged 1 commit into
devfrom
security/b13-audit-fixes
Oct 6, 2026
Merged

3rdIteration merged 1 commit into
devfrom
security/b13-audit-fixes

Conversation

@3rdIteration

Copy link
Copy Markdown
Owner

Fixes findings 1–6 from the B13 release security audit. To be merged as part of B13.

Fixes

  1. Verify Signature passed unsigned lines in clearsigned manifests (High). gpg --verify reports VALIDSIG even when unsigned text is added before or after a clearsigned block, or a second block is appended. Confirmed on GnuPG 2.4.9. Check SHA256Sum then hashed every line of the raw file, so an added <hash> <file> line showed as a green "Matched SHA256". Clearsigned files with any content outside the signed block are now refused. Manifests with an embedded signature are hash-checked only from the text gpg --decrypt reports as signed, never from the raw file. Detached .sig/.asc behaviour is unchanged.
  2. Provision MicroSD could write outside the card (Medium). sd_update.txt is unsigned, and the image names it lists were joined onto the card root, so a name like ../x copied a file (as root) outside it. Only bare filenames are now accepted. Bad names are refused before the write-length fix or any copy happens.
  3. Secrets in logs (Medium). encryption_key (the EncryptedQR/KEF passphrase) and text (typed Text QR content) are now redacted from Destination reprs, which are logged at INFO.
  4. Release-signing keys survived the wipe (Medium). SeedKeeper-loaded keys left behind by an abandoned flow were never cleared by Home or the inactivity wipe. Both now clear those keys and the BIP85 cache via clear_signing_keys().
  5. Blind digest signing (Medium). Sign Digests and air-gap Rounds 1–2 now show a "Signing blind" confirmation before any key is loaded. Back cancels.
  6. Subkey signers marked untrusted (Low). _parse_gpg_verify_status now takes the primary-key fingerprint from the last field of VALIDSIG. Releases signed with a subkey now match the trusted-signer list, which holds primary-key fingerprints.

Tests

  • New tests for each fix. All 14 fail on dev and pass here.
  • Air-gap ceremony flow test: its signing rounds now press "Sign" on the new confirmation.
  • Local full suite, excluding live-hardware tests: 2564 passed. The three remaining failures are environment-only and also fail on dev: two need compiled .mo translations that aren't built locally; one is a local pysatochip install older than the pinned build.

🤖 Generated with Claude Code

…log hygiene)

1. Verify Signature: refuse clearsigned files with text outside the signed
   block. gpg --verify reports VALIDSIG even when unsigned lines surround a
   clearsigned block (confirmed on GnuPG 2.4.9), and Check SHA256Sum hashed
   every line of the raw file, so an added "<hash>  <file>" line was shown as
   a matched, signed checksum. Embedded-signature manifests are now hashed
   only from the text gpg --decrypt reports as signed.
2. Provision MicroSD: sd_update.txt is unsigned, and the image names it lists
   were joined onto the card root, so "../x" copied files outside the card.
   Only bare filenames are accepted, refused before anything is written.
3. Redact encryption_key (EncryptedQR/KEF passphrase) and text (Text QR
   content) from Destination reprs, which are logged at INFO.
4. Clear Luckfox release-signing keys (BIP85 cache and unconsumed
   SeedKeeper-loaded keys) on Home and in the inactivity wipe.
5. Air-gap digest signing: warn that digests are signed blind and require a
   confirmation before keys are loaded.
6. GPG status parsing: take the primary-key fingerprint from VALIDSIG's last
   field so subkey-signed releases match the trusted-signer whitelist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@3rdIteration
3rdIteration merged commit 585dc0e into dev Oct 6, 2026
29 checks passed
@3rdIteration
3rdIteration deleted the security/b13-audit-fixes branch October 6, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant