Security context

What an agent needs to avoid regressing past fixes and find the next vuln in this repo.

nesquena/hermes-webui
master @ d13da42
163
Fixes
0
CVEs
HIGH
Peak severity
54.3%
Coverage
Highlights
Path Traversal: 41 prior fixes. Scrutinize any change in this area.
api/routes.py: most-fixed (57 issues). Treat as high-risk during review.
74 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns

The bug types that recur here, drawn from past fixes, not open vulnerabilities.

Path Traversal: Workspace and static file operations frequently bypassed validation checks via symlink-swaps, double dots, or alternate file extensions. Robust defense requires canonicalization (resolve) combined with strict subpath containment (is_relative_to/commonpath) and using file descriptors with O_NOFOLLOW to mitigate TOCTOU races.
Auth Bypass: Active profiles and their API keys frequently leaked across boundaries due to reliance on shared process-global environments (os.environ). Mitigating these leaks required migrating profile contexts to thread-local variables and isolating credential caches using profile-scoped keys.
Denial of Service: Server connection pool saturation and file descriptor leaks occurred across long-lived SSE, database connections, and subprocess invocations. Solved via explicit resource closing on LRU eviction, try/finally database wrappers, socket write deadlines, and spawning supervisors.