Commit Graph
555 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN e59cc1af2e Fix timing attack vulnerability in token verification
Replaced insecure string comparison with `secrets.compare_digest` in `_check_token` to prevent timing attacks.
Added a test case for missing token to ensure robust error handling.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 17:44:02 +00:00
thePR0M3TH3AN 46f753a11a Merge pull request #870 from PR0M3TH3AN/fix-key-derivation-salt-12798847451274058286
🔒 Fix Weak Key Derivation by Adding Salt
2026-02-16 12:24:12 -05:00
thePR0M3TH3AN 8adc1e7220 Merge pull request #869 from PR0M3TH3AN/improve-inmemory-secret-error-handling-18204251655789169400
Improve InMemorySecret wiped state error handling and testing
2026-02-16 12:23:12 -05:00
google-labs-jules[bot]andPR0M3TH3AN 75fe5bc382 Fix weak key derivation by adding salt to parent seed encryption
Introduced a random salt to key derivation for parent seed encryption to prevent rainbow table attacks. The salt is now stored in the `parent_seed.enc` file header (V3 format).

*   Modified `src/utils/key_derivation.py` to accept optional `salt` argument.
*   Modified `src/seedpass/core/encryption.py` to read/write salt in `parent_seed.enc` using V3 format (V3:salt:nonce:ciphertext).
*   Modified `src/seedpass/core/manager.py` to generate salt for new seeds and read salt for existing ones.
*   Added auto-upgrade logic for legacy (no salt) seeds upon access.
*   Updated tests to verify salt usage and backward compatibility.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 17:22:54 +00:00
google-labs-jules[bot]andPR0M3TH3AN d729466513 test(utils): Add test and error handling for wiped InMemorySecret
- Updated `InMemorySecret.get_bytes()` in `src/utils/memory_protection.py` to raise a `RuntimeError` if the secret has been wiped, replacing the previous `AttributeError`.
- Added `test_access_after_wipe_raises_error` to `src/tests/test_memory_protection.py` to verify this behavior.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 17:21:45 +00:00
thePR0M3TH3AN 21c25a0b63 Merge pull request #868 from PR0M3TH3AN/security-fix-path-traversal-17059275168502501133
🔒 Security Fix: Arbitrary File Read via Path Traversal in import_vault
2026-02-16 12:21:21 -05:00
google-labs-jules[bot]andPR0M3TH3AN 9c6b6d221c Fix Arbitrary File Read via Path Traversal in import_vault endpoint
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 17:20:28 +00:00
google-labs-jules[bot]andPR0M3TH3AN 91f39007f0 Fix arbitrary file write via path traversal in backup_parent_seed
The `backup_parent_seed` API endpoint was vulnerable to arbitrary file write via path traversal.
The `path` parameter was used directly to create a `Path` object, which was then passed to `_pm.handle_backup_reveal_parent_seed`.
This allowed an attacker to specify an arbitrary path (e.g., `../../evil_file`), which would be used by `encrypt_and_save_file` to write the encrypted seed to that location.

This commit fixes the vulnerability by validating that the `path` parameter is a valid filename (i.e., does not contain path separators or parent directory references) before processing it. This ensures that the backup file is always created within the intended fingerprint directory.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 17:17:44 +00:00
thePR0M3TH3AN 335de7abe3 Merge pull request #865 from PR0M3TH3AN/fix-sensitive-token-leak-stdout-13051886765392610577
🔒 Fix sensitive API token exposure in stdout
2026-02-16 11:48:09 -05:00
google-labs-jules[bot]andPR0M3TH3AN 99baf16b1b 🔒 Fix sensitive API token exposure in stdout
Removed the `print` statement in `src/seedpass/api.py` that leaked the
API token to stdout.

Enhanced the API server and CLI to support secure token management:
- Added `SEEDPASS_API_TOKEN` environment variable support in both
  `api.py` and `cli.py`.
- Added a `--token` option to the `api start` CLI command.
- Redirected the auto-generated token output to stderr instead of stdout.
- Updated `api stop` to respect the `SEEDPASS_API_TOKEN` environment
  variable.

These changes prevent the API token from being easily logged in insecure
environments where stdout is captured.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 16:47:51 +00:00
google-labs-jules[bot]andPR0M3TH3AN cc42e7d6f0 chore: remove dead code from src/utils/imghdr_stub.py
Removed the `test()` and `testall()` functions and the `if __name__ == "__main__":` block which were used for manual testing and are not needed by the codebase.
This improves maintainability and readability by focusing the module on its core functionality.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 16:42:01 +00:00
google-labs-jules[bot]andPR0M3TH3AN 0a349df058 chore(ai): style-agent run
- Formatted 8 files with black.
- Ran flake8 and logged warnings.
- Verified with pytest.
- Scheduler operations completed (lock check, lock, complete).
- Wrote task log to torch/task-logs/daily/.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 12:54:54 +00:00
thePR0M3TH3AN 7f503f0787 feat: add quick password entry mode 2025-08-02 16:43:43 -04:00
thePR0M3TH3AN dcd095d1af Include entry type in search results 2025-08-02 16:26:52 -04:00
thePR0M3TH3AN cc8fba9f12 Add key validation utilities and integrate 2025-08-01 10:38:40 -04:00
thePR0M3TH3AN 144751ef02 fix exit crash when nostr client missing 2025-08-01 09:28:49 -04:00
thePR0M3TH3AN 9adb539b84 Keep stats screen visible 2025-08-01 08:32:44 -04:00
thePR0M3TH3AN 77757152d7 Add async background sync task management 2025-07-31 19:38:09 -04:00
thePR0M3TH3AN e3bd669668 Add Nostr restore guidance and tests 2025-07-31 18:28:48 -04:00
thePR0M3TH3AN 6d82ef1815 Add StatsManager for single display 2025-07-31 16:01:40 -04:00
thePR0M3TH3AN 47da67b37c Improve import handling 2025-07-31 15:47:24 -04:00
thePR0M3TH3AN ceb2eb28ad Fix Nostr manifest handling 2025-07-31 14:42:53 -04:00
thePR0M3TH3AN 37fc2779ad Add Nostr restore option and test 2025-07-31 13:26:25 -04:00
thePR0M3TH3AN 78bf5a4c64 Add SSH and managed account modify handling 2025-07-31 13:06:12 -04:00
thePR0M3TH3AN 0a078bbcf4 Show notes when viewing password entries 2025-07-31 10:27:17 -04:00
thePR0M3TH3AN 05eae9bddd Add tests for password special character modes 2025-07-31 08:58:33 -04:00
thePR0M3TH3AN a7a2e70321 Import safe special chars constant 2025-07-31 08:37:42 -04:00
thePR0M3TH3AN d3bd3b9e0a docs: document new password policy flags 2025-07-30 22:08:04 -04:00
thePR0M3TH3AN 6d6a284096 Add password policy options to API 2025-07-30 21:23:18 -04:00
thePR0M3TH3AN b74c0993ca Prompt for per-entry password policy 2025-07-30 20:55:56 -04:00
thePR0M3TH3AN b57e19b657 feat: extend password options 2025-07-30 20:22:53 -04:00
thePR0M3TH3AN b4d60782af Add per-entry password policy overrides 2025-07-30 19:57:38 -04:00
thePR0M3TH3AN 7dba8e138d Add password policy config options 2025-07-30 19:10:10 -04:00
thePR0M3TH3AN dcb5c6e805 Extend password policy and generator 2025-07-30 18:44:41 -04:00
thePR0M3TH3AN 627d69cf30 Add edit options for key/value entries 2025-07-30 16:51:53 -04:00
thePR0M3TH3AN 2f7b41c5dd Merge branch 'beta' into codex/rename-label-field-and-add-key-field-editing 2025-07-30 16:16:22 -04:00
thePR0M3TH3AN bb1d692798 Add value editing for Key/Value entries 2025-07-30 16:05:01 -04:00
thePR0M3TH3AN 3937ccfb75 Allow editing Key field in Key/Value entries 2025-07-30 15:50:48 -04:00
thePR0M3TH3AN acb1126287 Fix nostr dependency 2025-07-30 15:14:11 -04:00
thePR0M3TH3AN bcd8002e1d Pin nostr-sdk to 0.42.x 2025-07-30 14:45:53 -04:00
thePR0M3TH3AN 4a20817094 Add key field to key/value entries 2025-07-28 15:04:56 -04:00
thePR0M3TH3AN a3d45a117c Fix relay URL handling for nostr-sdk 0.43 2025-07-28 13:55:55 -04:00
thePR0M3TH3AN 2d39d7a5bd feat(stats): refresh triggers background sync 2025-07-28 13:31:15 -04:00
thePR0M3TH3AN 0edf4e5c83 test: add race condition sync test 2025-07-24 21:47:04 -04:00
thePR0M3TH3AN ea2451f4a0 Persist manifest state 2025-07-24 21:04:04 -04:00
thePR0M3TH3AN 747e2be5a9 Add modified_ts tracking and merge logic 2025-07-24 20:28:21 -04:00
thePR0M3TH3AN cb1e18c8ba Add manifest consistency check and tests 2025-07-24 20:05:30 -04:00
thePR0M3TH3AN 24a606fb70 Apply sequential deltas from Nostr 2025-07-24 19:41:35 -04:00
thePR0M3TH3AN 529eb5a0a6 Ensure thread-safe NostrClient state reads 2025-07-24 19:28:35 -04:00
thePR0M3TH3AN 64a84c59d7 Add thread-safe state access in NostrClient 2025-07-24 19:05:31 -04:00