Summary
A directory traversal vulnerability in hermes-studio v0.6.26 affects path validation in the Hermes download API. A remote attacker may access sensitive files when user-controlled path input reaches the download endpoint without sufficient restriction.
Affected context
The vulnerability occurs in deployments of hermes-studio v0.6.26 that expose the api/hermes/download endpoint and rely on the validatePath function to authorize requested file paths. Risk depends on whether the endpoint is reachable by an attacker and whether its process has read access to sensitive files outside the intended download directory.
Exploit preconditions
- Attack surface: The remotely accessible
api/hermes/downloadendpoint - Required access: Network access to the endpoint; authentication requirements depend on the deployment configuration
- Trigger point: Processing a file or path request through the
validatePathfunction - Why exploitation is possible: Insufficient path restriction may allow attacker-controlled path references to resolve outside the intended directory
Why this happens
The underlying bug is improper limitation of a pathname to an approved directory boundary. When user-controlled path components are validated incompletely or before canonicalization, traversal sequences or equivalent path representations may cause the application to access files outside the intended location. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Potential impact
- An attacker may read application configuration files
- Sensitive credentials or tokens could be disclosed
- Internal source code or operational data may be exposed
- The application could be used to reveal information useful for subsequent attacks
General mitigation guidance
Mitigation generally focuses on making file access constrained by design rather than trusting client-supplied paths.
Common defensive patterns include:
- Mapping opaque download identifiers to server-side file records instead of accepting arbitrary paths
- Canonicalizing paths before authorization checks and enforcing a fixed, approved directory boundary
- Rejecting traversal indicators, unexpected encodings, symbolic links, and absolute paths where they are not required
- Applying allowlists for downloadable files and validating expected file types
- Running the service with the minimum filesystem permissions needed for its function
- Avoiding storage of secrets and sensitive files in directories readable by the download process
How teams detect issues like this
Detection approaches may include:
- Static analysis rules for filesystem APIs receiving request parameters or other untrusted input
- Code review checks for path validation performed before canonicalization or without a directory-boundary comparison
- Dynamic testing of download endpoints with normalized, encoded, absolute, and symbolic-link path variants
- Web application monitoring for repeated invalid path requests and access attempts outside approved download roots
- Policy enforcement requiring server-side resource identifiers and allowlisted file access
Automated security review tools may help identify path construction and validation patterns that warrant manual investigation.

