/

CVE-2026-49957

Severity:

HIGH RISK

(7.7)

Path Traversal (CWE-22) in Hermes WebUI Workspace Logic

CVE-2026-49957

Deferred

Vulnerability type

Category:

Path Traversal / Directory Traversal

CWE:

CWE-22

Impact:

Unauthorized File System Access / Data Exposure

Severity:

HIGH RISK

(7.7)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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.

Sources

SourceLink
github.comgithub.com/nesquena/hermes-webui/commit/91a89fb5d5c0bf87932917f9914ad0150ea62fe4
github.comgithub.com/nesquena/hermes-webui/pull/3731
github.comgithub.com/nesquena/hermes-webui/pull/3744
github.comgithub.com/nesquena/hermes-webui/releases/tag/v0.51.296
vulncheck.comvulncheck.com/advisories/hermes-webui-workspace-boundary-bypass-via-api-workspace-py

Frequently asked

questions

Exploitation is limited to authenticated users who can configure SSH/remote terminal profiles, but within that scope they may be able to read sensitive system files that were intended to remain outside any workspace.

The attacker typically needs a role that permits creating or editing remote terminal profiles or their working directories; the vulnerability does not by itself grant authentication or role escalation, it misuses existing capabilities.

The most robust fix is to centralize path validation and ensure all workspace candidate paths are fully resolved, normalized, and then checked against blocked-path and allowlist rules with no early exits before those checks complete.

Adopt a design where all user-controlled paths are treated as untrusted, strictly constrain them to known workspace roots with allowlists, enforce validation through shared utilities, and include regression tests and static analysis rules that target CWE-22 patterns.

Find out what's already
exploitable in your codebase.