Skip to content

Mask Generated Mnemonic Output to Prevent Terminal and Log Leaks - #9

Open
mozluk wants to merge 1 commit into
Quantus-Network:mainfrom
mozluk:mozluk-patch-1
Open

mozluk wants to merge 1 commit into
Quantus-Network:mainfrom
mozluk:mozluk-patch-1

Conversation

@mozluk

@mozluk mozluk commented Sep 14, 2026

Copy link
Copy Markdown

Description

This pull request resolves a high-severity credential exposure finding in quantus-wasm identified during the Quantus workspace security audit (FM-12)[cite: 51].

Previously, the CLI wallet demonstration script (examples/wallet.mjs) printed the complete, unredacted 24-word recovery phrase directly to stdout upon running generate[cite: 51]. Because standard output is routinely captured by shell scrollback buffers, process history, and continuous integration logs, this behavior leaked full cryptographic control of newly generated accounts to unintended observers and persistent log files[cite: 51].

Key Changes & Remediations

Masked Mnemonic Console Output (FM-12 - examples/wallet.mjs)

  • Redacted Standard Output: Replaced the full recovery phrase printout in the generate command with a masked summary displaying only the first and last words alongside the word count[cite: 51, 62]: ```javascript const words = mnemonic.split(" "); const masked = ${words[0]} ... ${words[words.length - 1]} (${words.length} words — full phrase intentionally NOT printed); console.log(`mnemonic: ${masked}`);


### Description
This pull request resolves a high-severity credential exposure finding in `quantus-wasm` identified during the Quantus workspace security audit (**FM-12**)[cite: 51].

Previously, the CLI wallet demonstration script (`examples/wallet.mjs`) printed the complete, unredacted 24-word recovery phrase directly to `stdout` upon running `generate`[cite: 51]. Because standard output is routinely captured by shell scrollback buffers, process history, and continuous integration logs, this behavior leaked full cryptographic control of newly generated accounts to unintended observers and persistent log files[cite: 51].

### Key Changes & Remediations

#### Masked Mnemonic Console Output (FM-12 - `examples/wallet.mjs`)
* **Redacted Standard Output:** Replaced the full recovery phrase printout in the `generate` command with a masked summary displaying only the first and last words alongside the word count[cite: 51, 62]:
  ```javascript
  const words = mnemonic.split(" ");
  const masked = `${words[0]} ... ${words[words.length - 1]} (${words.length} words — full phrase intentionally NOT printed)`;
  console.log(`mnemonic: ${masked}`);
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