Severity:

HIGH RISK

(8.1)

Path Traversal in Hermes WebUI delete Endpoint

CVE-2026-6832

Analyzed

Vulnerability type

Category:

Path Traversal / Directory Traversal

CWE:

CWE-22

Impact:

Arbitrary File Deletion

Severity:

HIGH RISK

(8.1)

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 exposes an arbitrary file deletion issue where the /api/session/delete endpoint accepts unvalidated session identifiers as filesystem paths.

An authenticated attacker can supply absolute or traversal-based paths in the session_id parameter to delete JSON files outside the intended session directory, potentially disrupting application behavior or destroying important data.

Affected context

This vulnerability occurs in deployments of Hermes WebUI that:

  • Expose the /api/session/delete HTTP endpoint to authenticated users
  • Derive filesystem paths from the session_id parameter
  • Assume session identifiers are confined to a predefined SESSION_DIR
  • Operate on a filesystem where the application has write/delete permissions to JSON files beyond the session directory

The risk is higher when the application runs with broad filesystem permissions or on shared hosts where JSON configuration or data files are critical.

Exploit preconditions

  • Attack surface: HTTP API, specifically the /api/session/delete endpoint.
  • Required access: Valid authenticated access to Hermes WebUI sufficient to invoke session deletion.
  • Input control: Ability to supply arbitrary values in the session_id parameter (e.g., absolute paths or ../ traversal sequences).
  • Trigger point: Server-side file deletion logic that constructs a path from session_id and performs a delete operation.
  • Why exploitation is possible: The implementation trusts session_id as a safe identifier and does not normalize, constrain, or validate the resulting path against the SESSION_DIR boundary before deleting the target file.

Why this happens

The underlying issue is an improper restriction of pathnames derived from user-controlled input, mapped to CWE-22 (Improper Limitation of a Pathname to a Restricted Directory).

Instead of treating session_id as an opaque token, the code appears to concatenate it directly with a base directory or accept it as an absolute path, then passes the resulting path to a delete operation.

Without robust canonicalization and boundary checks, attackers can craft session_id values that include absolute paths or directory traversal sequences (e.g., ../) to escape SESSION_DIR and target arbitrary writable JSON files.

Conceptually, this pattern confuses an untrusted identifier (session_id) with a trusted filesystem path, breaking the assumption that operations are confined to a safe directory.

Potential impact

  • Deletion of JSON session files, causing user sessions or workflows to fail.
  • Deletion of application JSON configuration or state files, leading to outages or misconfiguration.
  • Destruction of critical data stored in JSON format, potentially resulting in data loss and integrity issues.
  • Facilitation of further attacks by removing security-related files (e.g., audit logs or controls) if they are JSON and writable.
  • Service instability or denial of service if key application resources are deleted.

General mitigation guidance

Effective mitigation focuses on treating session identifiers as opaque tokens and strictly constraining filesystem operations:

  • Construct file paths by combining a fixed, trusted base directory (SESSION_DIR) with sanitized filenames, not arbitrary user-supplied paths.
  • Normalize and canonicalize the resulting path, then enforce that it remains under the intended SESSION_DIR before performing any delete operations.
  • Reject any session_id containing path separators, traversal tokens, or absolute-path indicators; treat it as an identifier rather than a path.
  • Implement allowlists for expected filename patterns (e.g., alphanumeric IDs with a fixed extension) instead of accepting arbitrary strings.
  • Run the application with least-privilege filesystem permissions so it can only modify files within its dedicated data directories.
  • Consider abstracting file management behind higher-level storage APIs rather than directly operating on raw filesystem paths.

How teams detect issues like this

Organizations can identify and monitor for this vulnerability through:

  • Static analysis rules that flag the use of user-controlled parameters (like session_id) in filesystem APIs (unlink, remove, delete) without validation or path normalization.
  • Code review checklists that require reviewers to verify directory confinement and canonicalization for any file deletion or modification functionality.
  • Runtime monitoring of file deletion events from the application process, especially deletes targeting paths outside the expected session directory.
  • Logging and anomaly detection on the /api/session/delete endpoint, alerting on unusual session_id values (absolute paths, ../ sequences, or unexpected file locations).
  • Integration of automated security scanning tools in CI that look for CWE-22 patterns and enforce policy on path construction.

Sources

SourceLink
github.comgithub.com/nesquena/hermes-webui/commit/3cc5839bf303fa6758bfdac538507407a2929655
github.comgithub.com/nesquena/hermes-webui/pull/409
github.comgithub.com/nesquena/hermes-webui/pull/412
github.comgithub.com/nesquena/hermes-webui/releases/tag/v0.50.132
github.comgithub.com/nesquena/hermes-webui/releases/tag/v0.50.32
vulncheck.comvulncheck.com/advisories/nesquena-hermes-webui-arbitrary-file-deletion-via-unvalidated-session-id

Frequently asked

questions

Yes. As long as an attacker can authenticate to Hermes WebUI and reach the /api/session/delete endpoint, they can attempt to exploit the vulnerability remotely by crafting malicious session_id values.

The attacker must have enough privileges to access the session deletion endpoint, but typically does not need system-level or shell access. Application-level authentication that grants access to session management is usually sufficient.

Treat session_id as an opaque identifier, not a path. Build paths from a fixed base directory with strict validation, normalize the resulting path, and enforce that it resides under the intended directory before performing any deletion. Reject any input that does not conform to a narrow, expected pattern.

Adopt a standard secure coding pattern for file operations: avoid using raw user input as filesystem paths, employ canonicalization and directory boundary checks, enforce least-privilege filesystem permissions, and include CWE-22 checks in code review and automated analysis pipelines.

Find out what's already
exploitable in your codebase.