Skip to content

persistent-setup: trust Tails passphrase policy - #243

Closed
BenWestgate wants to merge 1 commit into
masterfrom
codex/240-passphrase-followup
Closed

BenWestgate wants to merge 1 commit into
masterfrom
codex/240-passphrase-followup

Conversation

@BenWestgate

@BenWestgate BenWestgate commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

Refs #240.

Summary

  • keep the Tails 7.13 pinentry passphrase prompt open indefinitely
  • stop re-scoring a passphrase already accepted by Tails Persistent Storage
  • remove the contradictory Bails weak-passphrase/reboot gate

Reproduction

On master at 5147ffd in Tails 7.13:

  • leaving the pinentry prompt idle fell through to “Existing Persistent Storage passphrase is required”
  • Bails stripped spaces before keepassxc-cli estimate, so random-word passphrases could be scored as a concatenated token and rejected after Tails had already accepted them

The two later master commits change install-core and review automation only; this one-file PR remains mergeable without a rebase.

Testing

  • reproduced both reported behaviors in the same Tails 7.13 VM
  • patched pinentry remained open past 50 seconds
  • a five-word BIP39-style passphrase advanced through setup without the Bails weak-passphrase gate
  • bash -n bails/.local/bin/persistent-setup
  • shellcheck bails/.local/bin/persistent-setup
  • git diff --check origin/master...HEAD
  • Lint CI, CodeQL, and dependency review pass

@BenWestgate BenWestgate left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI-generated review (Claude), posted at the maintainer's request.

ACK the --timeout 0 half of 3c36717. The gate removal needs discussion.

  • pinentry-gnome3 --timeout 0 fixes the idle fall-through.
  • "Accepted by Tails" means the passphrase unlocks Persistent Storage; it doesn't mean it met a strength bar. Does Tails enforce a minimum? If not, this drops the only check. A smaller fix for the reported bug is to stop stripping spaces ("$existing_passphrase" instead of "${existing_passphrase// /}") and make the <50-bit case a warning rather than a forced reboot.
  • Merges cleanly with #202, #217 and #234.

@BenWestgate

Copy link
Copy Markdown
Owner Author
  • "Accepted by Tails" means the passphrase unlocks Persistent Storage; it doesn't mean it met a strength bar. Does Tails enforce a minimum? If not, this drops the only check. A smaller fix for the reported bug is to stop stripping spaces ("$existing_passphrase" instead of "${existing_passphrase// /}") and make the <50-bit case a warning rather than a forced reboot.

Tails does not force a minimum. They recommend 5 to 7 random words and the Persistent Storage app shows 6.

@BenWestgate

BenWestgate commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner Author

A smaller fix for the reported bug is to stop stripping spaces ("$existing_passphrase" instead of "${existing_passphrase// /}") and make the <50-bit case a warning rather than a forced reboot.

I would ACK this.

Copy link
Copy Markdown
Owner Author

Superseded by #289. That stacked PR keeps this fix (trust Tails' passphrase policy and indefinite pinentry) while moving all optional passphrase-training ownership out of persistent-setup, so keeping both PRs open would duplicate edits in the same boundary.

BenWestgate added a commit that referenced this pull request Oct 1, 2026
…292)

* persistent-setup: score passphrases with their spaces

Stripping spaces before keepassxc-cli estimate scored random-word
passphrases as one concatenated token, so a five-word passphrase could
fall below 50 bits and force a reboot. Keep the spaces, and let the
lowest-score warning continue instead of rebooting unconditionally.

Refs #243.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019JziKN4UP3pEXBVsdSYJDQ

* persistent-setup: keep word separators out of the entropy score

Scoring the passphrase with its spaces credited each separator as
entropy, so four common words passed as 70 bits. Strip spaces again;
random EFF-list passphrases of 6+ words still score above 65 bits, and
the weakest case now warns instead of forcing a reboot.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019JziKN4UP3pEXBVsdSYJDQ

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Tails Tester <tails-test@localhost>
BenWestgate pushed a commit that referenced this pull request Oct 2, 2026
Tails 7.6 replaced KeePassXC with Secrets, so keepassxc-cli no longer
exists. The empty estimate counted as zero bits, and every existing
passphrase was reported as too weak, however strong.

Estimate with zxcvbn instead, the same estimator KeePassXC used. Tails
7.14 ships its Rust port, zxcvbn_rs_py, as a dependency of Secrets;
fall back to the Python zxcvbn where that is what is installed. The
Rust port counts guesses in 64 bits, so it reports at most 64 bits of
strength. Pass at 64 bits instead of 65, so that a passphrase of 5 or
more random words, as Tails recommends, still passes.

Pass the passphrase on stdin so it never appears in a process list.
If no estimator is installed, say the strength was not checked
instead of calling the passphrase weak.

Refs #243
BenWestgate pushed a commit that referenced this pull request Oct 3, 2026
Tails 7.6 replaced KeePassXC with Secrets, so keepassxc-cli no longer
exists. The empty estimate counted as zero bits, and every existing
passphrase was reported as too weak, however strong.

Estimate with zxcvbn instead, the same estimator KeePassXC used. Tails
7.14 ships its Rust port, zxcvbn_rs_py, as a dependency of Secrets;
fall back to the Python zxcvbn where that is what is installed. The
Rust port counts guesses in 64 bits, so it reports at most 64 bits of
strength. Pass at 64 bits instead of 65, so that a passphrase of 5 or
more random words, as Tails recommends, still passes.

Pass the passphrase on stdin so it never appears in a process list.
If no estimator is installed, say the strength was not checked
instead of calling the passphrase weak.

Refs #243
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