Skip to content

fix: production hardening v3 — 5 critical issues - #23

Merged
johnoct merged 2 commits into
mainfrom
fix/production-hardening-v3
Feb 7, 2026
Merged

fix: production hardening v3 — 5 critical issues#23
johnoct merged 2 commits into
mainfrom
fix/production-hardening-v3

Conversation

@johnoct

@johnoct johnoct commented Feb 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Path traversal fix: validate filenames in /snapshots/<filename> — reject .. and /
  • Web server health check: monitor web_thread.is_alive() in main loop, auto-restart + notify on crash (extracted start_web_server() helper to avoid duplication)
  • Event log disk errors: wrap log_event() writes in try/except OSError — dropping an event beats crashing the monitor
  • Snapshot disk errors: wrap save_snapshot() in try/except OSError, print warning on failure
  • Fix pyproject.toml: add missing sounddevice>=0.4 to required dependencies (audio is on by default)

7 new tests covering all fixes. 202 total tests passing.

Test plan

  • python3 -m pytest tests/ -v — 202 passed
  • Verify /snapshots/../etc/passwd returns 400
  • Kill web server thread manually, verify restart + notification
  • Fill disk / make snapshot dir read-only, verify no crash

1. Snapshot path traversal: validate filename in /snapshots/<filename>
2. Web server health check: monitor thread, restart + notify on crash
3. Event log disk errors: wrap writes in try/except OSError
4. Snapshot disk errors: catch OSError, warn on save failure
5. Fix pyproject.toml: add missing sounddevice dependency
@johnoct
johnoct merged commit 51b3553 into main Feb 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant