load_session/save_session built the session file path directly from the caller-supplied session_id with no validation, so a value like '../../../tmp/secrets' (reachable from the 'load-session' CLI subcommand) could read or write JSON files outside the session directory. Add _validate_session_id() to reject anything outside [A-Za-z0-9_-] (path separators, '..', absolute/Windows paths) before the id is used to build a filename. Legitimate ids (uuid4 hex, 'session-<digits>-<n>') are unaffected. Adds SessionStorePathTraversalTests covering traversal rejection on both load and save plus a legitimate-id round-trip. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_porting_workspace.py | ||
| test_pre_push_hook_contract.py | ||
| test_roadmap_helpers.py | ||
| test_security_scope.py | ||