Skip to content
This repository was archived by the owner on Aug 22, 2026. It is now read-only.

fix(security): complete hardening 0.2.4 — persistent lockout, Argon2, wordlist, CSV/backup - #12

Merged
j-kemble merged 3 commits into
developmentfrom
feature/hardening-complete-0.2.4
Aug 21, 2026
Merged

j-kemble merged 3 commits into
developmentfrom
feature/hardening-complete-0.2.4

Conversation

@j-kemble

Copy link
Copy Markdown
Owner

Corrected target: this PR was previously opened against main as #5 and squash-merged as 3992d49, which bypassed the development integration branch and would have broken the Papa (PyPI) distribution flow (publish.yml validates tags are ancestors of main). main has been hard-reset to bba2f42 (pre-merge).

This is the same hardening stack as #5, now targeting development as intended, including the two fixup commits that were missing from the squashed merge:

  • 871a37a — wordlist TOCTOU (O_NOFOLLOW/lstat), lockout clock docs, ctime/LIKE naming, cache eviction
  • f585c71 — CI fixes: trailing whitespace, mypy (focus_id, _ENTROPY_CACHE type), windows (signature cache + POSIX-only logging)

Base: development (3e296a7)
Head: feature/hardening-complete-0.2.4 (f585c71)
Replaces: #5 (closed, main has been reverted)

Verification:

  • git diff --check origin/main...HEAD clean
  • mypy generate_it → Success
  • pytest → 506 passed (windows logging tests skipped on win32)

…minima, wordlist validation, CSV/backup hardening

- Persistent lockout (config lockout_* keys, survives restart) with escalation preserved
- Argon2id minima 19456/2 (OWASP low) + downgrade warning, v1 PBKDF2 legacy flag + migrate prompt
- Wordlist: lstat symlink/size (5MiB/1M) + TOCTOU, lgamma entropy, bounded cache
- CSV: formula triggers +|+% , spreadsheet-safe, URL preserved, spreadsheet escaping
- Export chmod 0600 after replace, backup ctime ordering, B608 allow-list, LIKE limit noted
- Password lifetime: explicit overwrite/del in TUI/CLI, cache clear on lock
- Optimization: heapq for fuzzy limit, keyset pagination, lgamma, caches
- Bump 0.2.3 → 0.2.4, README Known Limitations, twine check passed

Co-Authored-By: internal
…docs, ctime/LIKE naming, cache eviction

- generator: use lstat + O_NOFOLLOW for wordlist hash/read to close
  TOCTOU symlink window (lstat re-validation after signature, fstat
  on O_NOFOLLOW fd, ELOOP->WordlistSecurityError), warn on missing
  GENERATE_IT_WORDLIST fallback
- storage: fix backup ctime doc (POSIX inode change vs creation),
  clarify _VAULT_SEARCH_SQL_LIKE_LIMIT vs _VAULT_SEARCH_SQL_LIMIT
  and search_credential_metadata LIMIT semantics
- constants: clarify search limit constants purpose
- tui: _lock_vault now clears wordlist + file-picker caches
- tui_security/storage: document wall-clock vs monotonic lockout
  persistence limitation and attempt-counter preservation, annotate
  downgrade warning as detection vs _validate_kdf_config prevention
- tests: update signature-cache test to count secure read path

Co-authored-by: Muse Spark
…ndows

- strip trailing whitespace across generate_it/ and tests/ to satisfy
  git diff --check (storage, tui, tui_render, tui_state, csv, security)
- tui: restore missing focus_items/focus_id definition in main loop
  (fixes mypy name-defined for focus_id and focus_items)
- tui_render: correct _ENTROPY_CACHE key type (str→bool at position 7)
  and remove stale type:ignore[arg-type] (fixes index error, unused-ignore)
- storage/tui/tui_security/__main__: remove unused type:ignore[assignment]
  and attr-defined/dict-item ignores (fixes warn_unused_ignores)
- tests: windows — make signature-cache test count only secure read
  (avoids double-count on nt where secure read falls back to Path.read_text)
  and skip POSIX-only logging checks on win32 (symlink/directory/chmod)
- tests: fix blank line at EOF in test_security_tui.py

Co-authored-by: Muse Spark
@j-kemble
j-kemble merged commit 4a12bc6 into development Aug 21, 2026
28 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant