Summary
Hermes WebUI before 0.51.269 contains a workspace boundary bypass that lets authenticated users configure remote terminal profiles to point at sensitive system directories.
By exploiting flawed workspace resolution logic, an attacker can trick the application into treating blocked paths like /etc as trusted workspace roots and read local system files via workspace helpers.
Affected context
The vulnerability occurs in Hermes WebUI deployments that expose SSH/remote terminal functionality and rely on workspace root checks to limit file system access.
It specifically affects the workspace resolution logic in _remote_terminal_workspace_candidate() used when configuring remote terminal working directories.
When users can adjust terminal profiles and the instance runs on hosts where system directories such as /etc are accessible, the flawed logic may treat those directories as trusted workspace roots despite intended restrictions.
Exploit preconditions
- Attack surface: Hermes WebUI interface and APIs that manage SSH/remote terminal profiles.
- Required access: Authenticated access with permission to create or modify remote terminal profiles or their working-directory settings.
- Trigger point: Configuration of a remote terminal working directory to a system path (e.g.,
/etc) that passes early workspace resolution checks. - Why exploitation is possible: An early return in
_remote_terminal_workspace_candidate()accepts certain paths as valid workspace roots before_is_blocked_workspace_path()is evaluated, effectively skipping the blocked-root guard and allowing file-read helpers to operate on system directories.
Why this happens
The root cause is a logic flaw in path validation and workspace boundary enforcement, aligning with CWE-22: Improper Limitation of a Pathname to a Restricted Directory.
The affected function performs workspace resolution and, under certain conditions, returns early after accepting the user-supplied directory as a trusted workspace root.
Because this early return occurs before the blocked-path guard (_is_blocked_workspace_path()) runs, paths that should be rejected (such as system directories) are instead treated as safe.
This reflects a broader pattern where security checks are ordered incorrectly or incomplete, allowing user-controlled paths to bypass intended directory restrictions.
Potential impact
- Unauthorized read access to sensitive configuration files under directories like
/etc. - Exposure of credentials, API keys, or system secrets stored in local configuration files.
- Leak of system-level information that could support privilege escalation or lateral movement.
- Violation of multi-tenant or workspace isolation assumptions within the Hermes WebUI environment.
General mitigation guidance
Effective mitigation focuses on enforcing path restrictions consistently and defensively across the workspace resolution flow:
- Ensure that blocked-path and workspace boundary checks run after all path normalization and resolution is complete, with no early returns that skip validation.
- Apply centralized path validation helpers that reject system directories, parent directory escapes, symlink tricks, and other non-workspace roots before they reach file-read helpers.
- Treat all user-configurable working-directory paths as untrusted input and validate them against an explicit allowlist of permitted workspace root locations.
- Run workspace and remote terminal processes with least-privilege file system permissions so that even if logical checks fail, access to sensitive system locations is minimized.
- Consider separating system directories and workspace data onto distinct mounts or containers to reduce the blast radius of misconfigurations.
How teams detect issues like this
Organizations can detect this class of issue using a mix of code-centric and operational approaches:
- Perform static analysis and code review focused on path handling functions, verifying that security checks execute after path resolution and before any file access.
- Search for early returns, conditionals, or special cases in workspace and remote terminal logic that bypass shared validation helpers such as
_is_blocked_workspace_path(). - Implement automated tests that attempt to configure workspaces or terminal profiles to system directories (e.g.,
/etc,/var,/root) and confirm access is denied. - Monitor application logs for unusual remote terminal working directories or workspace roots pointing to non-application locations on the host.
- Use security-focused linters or SAST tools configured with rules for CWE-22 patterns, including direct use of user-controlled paths in file operations.

