harden: the test recovery phrase ships inside the release artifacts, and the committed-key guard matches only by filename #351

Open
opened 2026-08-23 16:13:43 +02:00 by clawbot · 0 comments
Collaborator

Two build/release hygiene gaps disclosed by the review of #347 (#347 (comment)). Neither blocked that PR.

1. DEBUG_MNEMONIC survives in release bundles

The 12-word BIP-39 test phrase in src/shared/constants.js survives as a dead string literal in both release bundles — verified by grepping the unpacked artifacts, present in all four index.js files.

It is unreachable and harmless today: both bundles verify autistmask-build-debug=off, so no wallet is ever created from it, and the phrase is publicly committed anyway. It is also pre-existing, untouched by that PR.

What changed is that #310 made this the first build that ships a distributable artifact at all. A BIP-39 phrase embedded in a distributed wallet binary is worth removing on its own terms — it is the kind of string that scanners, auditors and users will find and have to reason about.

Not in milestone 1.0.0: it cannot be reached at runtime and the phrase is not secret.

2. The committed-private-key guard matches by filename extension only

tests/extensionId.test.js guards against committed private key material by checking filename extensions, so key material committed under an unexpected name passes it. Defense-in-depth gap rather than a defect — the review confirmed no key material is in the tree today.

Definition of done

  • The test recovery phrase does not appear in any emitted release bundle. Guard it behind the __BUILD_DEBUG__ define so esbuild folds it away in a release build.
  • script/verify-build fails if a BIP-39 test phrase appears in any emitted release bundle, so this cannot silently return.
  • The committed-key guard matches on content (a PEM/key header) rather than on filename alone.
  • Test for each. State the mutation and observed result for the verify-build check.
  • make check and both e2e suites green.
Two build/release hygiene gaps disclosed by the review of https://git.eeqj.de/sneak/AutistMask/pulls/347 (https://git.eeqj.de/sneak/AutistMask/pulls/347#issuecomment-69107). Neither blocked that PR. ## 1. `DEBUG_MNEMONIC` survives in release bundles The 12-word BIP-39 test phrase in `src/shared/constants.js` survives as a dead string literal in **both** release bundles — verified by grepping the unpacked artifacts, present in all four `index.js` files. It is unreachable and harmless today: both bundles verify `autistmask-build-debug=off`, so no wallet is ever created from it, and the phrase is publicly committed anyway. It is also pre-existing, untouched by that PR. What changed is that https://git.eeqj.de/sneak/AutistMask/issues/310 made this the first build that ships a distributable artifact at all. A BIP-39 phrase embedded in a distributed wallet binary is worth removing on its own terms — it is the kind of string that scanners, auditors and users will find and have to reason about. Not in milestone 1.0.0: it cannot be reached at runtime and the phrase is not secret. ## 2. The committed-private-key guard matches by filename extension only `tests/extensionId.test.js` guards against committed private key material by checking filename extensions, so key material committed under an unexpected name passes it. Defense-in-depth gap rather than a defect — the review confirmed no key material is in the tree today. ## Definition of done - [ ] The test recovery phrase does not appear in any emitted release bundle. Guard it behind the `__BUILD_DEBUG__` define so esbuild folds it away in a release build. - [ ] `script/verify-build` fails if a BIP-39 test phrase appears in any emitted release bundle, so this cannot silently return. - [ ] The committed-key guard matches on content (a PEM/key header) rather than on filename alone. - [ ] Test for each. State the mutation and observed result for the verify-build check. - [ ] `make check` and both e2e suites green.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#351