Commit Graph
1542 Commits
Author SHA1 Message Date
thePR0M3TH3AN b2a8fdefb0 Merge pull request #879 from PR0M3TH3AN/test-imghdr-stub-12332639906948512707
Add tests for imghdr_stub.py
2026-02-16 12:49:15 -05:00
thePR0M3TH3AN 10317aec03 Merge pull request #877 from PR0M3TH3AN/security-fix-token-timing-attack-14331876507002006471
🔒 Fix timing attack vulnerability in API token verification
2026-02-16 12:48:52 -05:00
thePR0M3TH3AN 48711a7320 Merge pull request #878 from PR0M3TH3AN/test-key-validation-coverage-8412470545867749142
🧪 Add error handling tests for key validation utils
2026-02-16 12:48:21 -05:00
thePR0M3TH3AN 9575ca1c7e Merge pull request #874 from PR0M3TH3AN/nostr-perf-concurrent-chunks-11272584633812719406
⚡ Concurrent Nostr snapshot chunk fetching
2026-02-16 12:47:58 -05:00
thePR0M3TH3AN 3b6325dc72 Merge pull request #872 from PR0M3TH3AN/code-health/remove-redundant-else-14874071705569730132
Refactor BIP85: Remove redundant elif block
2026-02-16 12:47:39 -05:00
google-labs-jules[bot]andPR0M3TH3AN 654f9c05a6 feat(test): add tests for imghdr_stub.py
Adds comprehensive tests for `src/utils/imghdr_stub.py` to ensure it correctly identifies image headers, covering all supported formats and edge cases. This is crucial as `imghdr` is removed in Python 3.13 and this stub is used by dependencies like `pgpy`.

- Added `src/tests/test_imghdr_stub.py` covering:
  - `what()` function with file paths, Path objects, file-like objects, and bytes.
  - All supported image formats (JPEG, PNG, GIF, TIFF, etc.).
  - Edge cases (empty file, short file, unknown type).
- Verified tests pass locally.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 17:47:23 +00:00
thePR0M3TH3AN 8b2534704f Merge pull request #875 from PR0M3TH3AN/refactor-file-lock-deduplication-16243706415213673778
Refactor file_lock.py to reduce code duplication
2026-02-16 12:47:00 -05:00
google-labs-jules[bot]andPR0M3TH3AN 3fd2470ccc Add error handling tests for key validation utils
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 17:45:53 +00:00
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
google-labs-jules[bot]andPR0M3TH3AN 154fb8d9cd ⚡ Optimize Nostr snapshot retrieval with concurrent fetching
Refactored `_fetch_chunks_with_retry` in `src/nostr/client.py` to fetch snapshot chunks concurrently using `asyncio.gather`.
Introduced a `asyncio.Semaphore(10)` to limit concurrency and prevent overwhelming relays.
Extracted single chunk fetch logic into `_fetch_single_chunk` helper method.
Added `sys.path` fix to `src/tests/test_nostr_snapshot.py` to enable running tests.

Performance improvement: ~10x speedup for 10 chunks (1.0s -> 0.1s in local reproduction).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 17:43:30 +00:00
google-labs-jules[bot]andPR0M3TH3AN 267ac5c3ca Refactor src/utils/file_lock.py to reduce duplication
Extracts common logic for path preparation and lock acquisition into a private helper function `_get_portalocker_lock`. This simplifies `exclusive_lock` and `shared_lock` implementations.

Also updates the docstring for `exclusive_lock` to correctly describe the file mode as "binary read/write mode" (r+b) instead of "binary append mode".

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 17:43:29 +00:00
google-labs-jules[bot]andPR0M3TH3AN 379d4ee98d Refactor BIP85: Remove redundant elif block
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 17:40:47 +00:00
thePR0M3TH3AN c1cbab8c70 Merge pull request #871 from PR0M3TH3AN/perf/optimize-totp-loop-8292868580025877023
⚡ Optimize TOTP derivation in GUI loop
2026-02-16 12:38:04 -05:00
google-labs-jules[bot]andPR0M3TH3AN afa35a1782 Optimize TOTP derivation in GUI loop by caching secrets
- Add `get_totp_secret` to `EntryManager` and `EntryService` to allow retrieving the secret (derived or imported) without calculating the code.
- Update `TotpViewerWindow` in GUI to cache TOTP secrets locally. This prevents expensive PBKDF2/BIP39 derivation on every UI refresh (every second).
- Clean up unused imports and f-strings in `entry_management.py`.

Benchmarks show a ~9x speedup for 10 frames (50 entries) and >100x speedup for steady state.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 17:37:03 +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
thePR0M3TH3AN a442229629 Merge pull request #867 from PR0M3TH3AN/fix-path-traversal-backup-parent-seed-11848666276588647800
Fix arbitrary file write via path traversal in backup_parent_seed
2026-02-16 12:20:37 -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
thePR0M3TH3AN d594d689d1 Merge pull request #864 from PR0M3TH3AN/remove-dead-code-imghdr-stub-1860538532359934490
🧹 [code health] Remove dead code from src/utils/imghdr_stub.py
2026-02-16 11:42:20 -05: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
thePR0M3TH3AN 8436311fa3 Merge pull request #863 from PR0M3TH3AN/agents/weekly/changelog-agent-2026-02-16-10358382466638125890
docs(ai): weekly changelog draft
2026-02-16 08:22:18 -05:00
thePR0M3TH3AN 61e7a9b045 Merge pull request #862 from PR0M3TH3AN/agents/daily/style-agent-16187229397196533781
style-agent: daily run
2026-02-16 08:21:39 -05:00
google-labs-jules[bot]andPR0M3TH3AN 9a2a8fd77d docs(ai): weekly changelog draft
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 12:56:27 +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 4dbd1db8c2 Merge pull request #861 from PR0M3TH3AN/agents/weekly/bug-reproducer-agent-innerhtml-repro-16374670332915725002
Weekly Scheduler Run: bug-reproducer-agent
2026-02-16 07:14:21 -05:00
google-labs-jules[bot]andPR0M3TH3AN 39f0407143 feat: reproduce innerhtml usage in torch/landing/index.html
- added reproduction script `torch/examples/reproducers/ISSUE_daily_style-agent_innerhtml/repro.py`
- updated `torch/src/issues/ISSUE_daily_style-agent_innerhtml.md` with reproduction results
- added `torch/KNOWN_ISSUES.md` with issue entry
- added missing scripts to `torch/package.json`
- generated scheduler artifacts (CONTEXT, TODO, DECISIONS, TEST_LOG, task-logs/weekly)

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 12:08:16 +00:00
google-labs-jules[bot]andPR0M3TH3AN 5f3d790822 feat: reproduce innerhtml usage in torch/landing/index.html
- added reproduction script `torch/examples/reproducers/ISSUE_daily_style-agent_innerhtml/repro.py`
- updated `torch/src/issues/ISSUE_daily_style-agent_innerhtml.md` with reproduction results
- added `torch/KNOWN_ISSUES.md` with issue entry
- added missing scripts to `torch/package.json`
- generated scheduler artifacts (CONTEXT, TODO, DECISIONS, TEST_LOG, task-logs/weekly)

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 11:57:32 +00:00
thePR0M3TH3AN 1e2c865b04 Merge pull request #860 from PR0M3TH3AN/agents/daily/scheduler-update-agent-1850363096375555446
docs(prompts): sync roster.json and scheduler rosters with prompt directories
2026-02-16 06:40:19 -05:00
google-labs-jules[bot]andPR0M3TH3AN 6871ce2b68 docs(prompts): sync roster.json and scheduler rosters with prompt directories
- Update src/prompts/roster.json with current agents
- Update src/prompts/daily-scheduler.md roster table
- Update src/prompts/weekly-scheduler.md roster table
- Create run artifacts (context, todo, decisions, test_logs)
- Create daily task log

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 11:32:13 +00:00
thePR0M3TH3AN 5bdde403e6 Merge pull request #859 from PR0M3TH3AN/setup-torch-14198365201963154658
Setup TORCH agent system
2026-02-16 06:15:19 -05:00
google-labs-jules[bot]andPR0M3TH3AN 77be82c09a Setup TORCH agent system
- Created `torch/` directory and initialized package.json
- Installed TORCH dependency from https://github.com/PR0M3TH3AN/TORCH
- Initialized TORCH environment with `npx torch-lock init`
- Updated .gitignore to exclude node_modules and generated files

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 05:33:36 +00:00
thePR0M3TH3AN a31db2bcd6 Update installation command in README.md
Add SEEDPASS_HEADLESS environment variable for installation.
2025-11-04 17:57:34 -05:00
thePR0M3TH3AN c9e7278c57 update 2025-11-04 17:36:36 -05:00
thePR0M3TH3AN c7f4617bba update 2025-11-04 17:09:34 -05:00
thePR0M3TH3AN 7bbe63261d update 2025-11-04 16:56:23 -05:00
thePR0M3TH3AN 80ea67e832 update 2025-11-04 16:47:19 -05:00
thePR0M3TH3AN 0d3d972abb Merge pull request #712 from PR0M3TH3AN/beta
Beta
2025-08-02 21:18:20 -04:00
thePR0M3TH3AN aeb146f862 Merge pull request #711 from PR0M3TH3AN/codex/add-password-mode-selection-and-quick-mode
feat: add quick password entry mode
2025-08-02 16:52:38 -04:00
thePR0M3TH3AN 7f503f0787 feat: add quick password entry mode 2025-08-02 16:43:43 -04:00
thePR0M3TH3AN 7a8c0aef86 Merge pull request #710 from PR0M3TH3AN/codex/add-entry-type-to-search-results
Include entry type in search results
2025-08-02 16:34:01 -04:00
thePR0M3TH3AN dcd095d1af Include entry type in search results 2025-08-02 16:26:52 -04:00
thePR0M3TH3AN b4f792ad67 Merge pull request #709 from PR0M3TH3AN/codex/add-key-validation-module-and-update-entrymanager
Add key validation helpers and enforce in entry management
2025-08-01 10:43:47 -04:00
thePR0M3TH3AN cc8fba9f12 Add key validation utilities and integrate 2025-08-01 10:38:40 -04:00
thePR0M3TH3AN 20896812a4 Merge pull request #708 from PR0M3TH3AN/codex/fix-exit-error-in-seedpass
Fix crash when exiting without Nostr client
2025-08-01 09:50:58 -04:00