Summary
Yamcs contains a path traversal vulnerability in its static file handler that can allow an unauthenticated requester to access readable files outside the configured web roots. The issue becomes risky when crafted request paths are resolved without canonicalization and boundary verification.
Affected context
The vulnerability occurs in Yamcs deployments that expose the HTTP StaticFileHandler and serve content from configured staticRoots. If request paths containing traversal segments are resolved without normalization and absolute-path checks, the resulting path may escape the intended static directory and reach readable operating-system or application files.
Exploit preconditions
- Attack surface: HTTP static-file serving endpoint - Required access: No authentication may be required when the affected
handler is publicly reachable
- Trigger point: Processing and resolution of a request path by
StaticFileHandler.locateFile
- Why exploitation is possible: The resolved path is not sufficiently
canonicalized and verified against the configured staticRoots before file
access
Why this happens
The underlying bug is improper limitation of a pathname to a restricted directory, which maps to CWE-22, Improper Limitation of a Pathname to a Restricted Directory. The handler resolves user-controlled path components without first obtaining a normalized absolute path and confirming that the final location remains beneath an approved static root. This permits traversal syntax to alter the effective filesystem target.
Potential impact
- An attacker may read sensitive operating-system files.
- An attacker could disclose application configuration and deployment data.
- Exposed credentials or tokens may enable further compromise.
- The vulnerability can increase the risk of lateral movement or data theft.
General mitigation guidance
Mitigation generally focuses on canonicalizing requested paths before access checks and enforcing that the resulting absolute path remains within an approved static root. Secure-by-default file-serving components should reject traversal segments, symbolic-link escapes, and ambiguous path encodings unless they are explicitly required. Static roots should contain only intended public content, configuration and secret files should be kept outside served directories, and the service should run with the least filesystem privileges necessary. Input trust should be reduced through strict route and filename allowlists, while deny-by-default access controls can limit exposure if a boundary check fails.
How teams detect issues like this
Detection approaches include static analysis for filesystem operations that combine request-controlled paths with file reads without normalization and containment checks. Code review should examine path canonicalization, symbolic-link handling, URL decoding order, and comparisons against trusted root directories. Runtime monitoring can alert on traversal markers, repeated requests for unexpected filesystem locations, and access to files outside approved content paths. Security policies and automated review tools may enforce approved path-resolution utilities and restricted static-root configurations.

