Executive brief
Hermes WebUI is a management interface for workspace operations. A security flaw in its Git cleanup process allows a local attacker to trick the system into deleting files outside of the intended workspace. This could lead to the accidental or malicious removal of critical system files or data stored elsewhere on the server, potentially causing service outages or data loss.
Technical details
A Time-of-Check Time-of-Use (TOCTOU) race condition exists in the git_discard function within api/workspace_git.py. The application performs a containment check using safe_resolve_ws() but subsequently uses standard Path.unlink() or shutil.rmtree() calls for deletion. An attacker with local workspace access can replace a validated path component with a symbolic link after the validation check but before the deletion occurs. This causes the application to follow the symlink and delete files or directories outside the configured workspace. The vulnerability is mitigated in version 0.51.303 by using anchored deletion helpers (unlink_anchored and rmtree_anchored) that verify the boundary at the time of the operation.
Affected products
- nesquena Hermes WebUI < 0.51.303
Timeline
- 2026-06-06: patched: Fix committed to repository
- 2026-06-09: disclosed: CVE published
References
- https://github.com/nesquena/hermes-webui/commit/4580f584964d640b95c4ffc9245a21ab926bec73
- https://github.com/nesquena/hermes-webui/pull/3702
- https://github.com/nesquena/hermes-webui/pull/3756
- https://github.com/nesquena/hermes-webui/releases/tag/v0.51.303
- https://www.vulncheck.com/advisories/hermes-webui-toctou-race-condition-via-git-discard