Skip to content

fix(cli): suppress terminal echo for interactive secret prompts#45

Merged
UnbreakableMJ merged 2 commits into
mainfrom
cli-secret-prompt-no-echo
Jun 22, 2026
Merged

fix(cli): suppress terminal echo for interactive secret prompts#45
UnbreakableMJ merged 2 commits into
mainfrom
cli-secret-prompt-no-echo

Conversation

@UnbreakableMJ

Copy link
Copy Markdown
Contributor

Problem

vault login / vault unlock echoed the master password in clear text as it was typed — visible on screen and in scrollback. The same flaw affected every other interactive secret prompt: the PIN, the add/edit login password, the card number/CVV, and the identity SSN/passport/license. Separately, the master-password path read stdin until EOF, so a typed password sat at the cursor until Ctrl-D instead of submitting on Enter.

Fix

  • Add a NoEcho RAII guard over rustix::termios that clears terminal ECHO for the duration of every interactive secret read and restores the prior attributes on drop — including on early return / panic.
  • rustix was already in the dependency tree transitively (via secmem-proc), so no new crate is added and the crate keeps #![forbid(unsafe_code)] (rustix is unsafe-free by design).
  • Interactive secret entry now submits on Enter (reads a single line) instead of reading until EOF.
  • Piped / redirected input is unchangedpass show | vault login still reads the whole stream, preserving the "stdin consumed → 2FA from /dev/tty" design.
  • Non-secret prompts still echo by design: the register server picker, account email, and the ephemeral authenticator (TOTP) code.

Verification

Full just ci set is green: fmt, clippy -D warnings (--all-features, all 9 crates), test --workspace --all-targets (75 passed, 0 failed), headless, version-gate, deny, audit, reuse.

Verified live through a pseudo-terminal driving vault login: the prompt appears, and the typed secret is absent from all terminal output.

---- raw pty capture (repr) ----
'Master password: \r\nvault: started vault-agent (pid ...)\r\n'
prompt shown : True
secret leaked: False
RESULT: PASS — password prompt shown, typed secret NOT echoed

🤖 Generated with Claude Code

UnbreakableMJ and others added 2 commits June 22, 2026 21:27
`vault login` / `vault unlock` echoed the master password in clear text as
it was typed (visible on screen and in scrollback); the PIN, the add/edit
login password, the card number/CVV, and the identity SSN/passport/license
prompts shared the same flaw.

Add a `NoEcho` RAII guard over `rustix::termios` that clears terminal ECHO
for the duration of every interactive secret read and restores the prior
attributes on drop (including on early return / panic). rustix was already
in the tree transitively via `secmem-proc`, so no new crate is added and
the crate keeps `#![forbid(unsafe_code)]`. Interactive entry now also
submits on Enter — the master-password path previously read until EOF, so a
typed password sat until Ctrl-D.

Piped / redirected input is unchanged (`pass show | vault login` still reads
the whole stream); non-secret prompts (the register server picker, account
email, the ephemeral authenticator code) still echo by design.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Remote memory-exhaustion (DoS) advisory in quinn-proto's out-of-order
stream reassembly, published 2026-06-22. quinn-proto is a phantom
Cargo.lock entry — an unenabled QUIC/HTTP3 path of reqwest; Vault speaks
HTTP/2 only, so it never enters the build graph and the flaw is
unreachable here — but cargo audit scans the lockfile literally, so pull
the patched release to keep the supply-chain gate green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@UnbreakableMJ UnbreakableMJ merged commit 9306e07 into main Jun 22, 2026
9 checks passed
@UnbreakableMJ UnbreakableMJ deleted the cli-secret-prompt-no-echo branch June 22, 2026 19:07
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