- Added
zypheron-ai/utils/secure_files.pywith shared helpers for:- validating session IDs against
^[A-Za-z0-9._-]{1,64}$ - resolving paths inside an expected base directory
- creating private files atomically with
0600 - ensuring private directories with
0700where supported
- validating session IDs against
- Hardened autopent session persistence in
zypheron-ai/autopent/session_state.py:- rejects unsafe session IDs before save, load, delete, autosave, and metadata lookup
- writes session JSON and HMAC sidecars atomically
- creates
session.keyprivately at creation time
- Hardened authenticated session storage in
zypheron-ai/auth/session_manager.py:- reuses the shared session ID validation and path resolution logic
- creates
sessions.keyprivately at creation time - writes encrypted session blobs atomically
- Hardened loot handling in
zypheron-ai/core/loot.py:- validates session IDs on construction and metadata lookup
- keeps loot paths contained under the configured loot base
- preserves
O_NOFOLLOWprotection for final file writes
- Removed secret previews from credential display in
zypheron-ai/autopent/credential_vault.py:- display output now uses a redacted form only
- logs and approval prompts no longer surface secret prefixes
- Hardened cluster secret creation in
zypheron-ai/distributed/network.py:cluster.secretis now created privately instead of chmodded after write
- Session ID traversal regression tests for autopent persistence
- Loot session containment tests
- Credential redaction tests
- Owner-only file mode checks for session and key files
- Passed:
./.venv/bin/python -m pytest --no-cov tests/test_security_remediation.py tests/test_autopent_runtime.py tests/test_scanner_safety.pyinzypheron-ai
- Partial:
./scripts/run_all_tests.sh --cistarted successfully and advanced through the API test suite, but the run became long-running and was interrupted before completion
- Invalid legacy session IDs are now rejected instead of being silently migrated.
- Existing valid session IDs such as
session-abc_123.1still work.