Summary
The Termix File Manager's GET /ssh/file_manager/ssh/resolvePath endpoint previously embedded a user-supplied path parameter directly into a shell command executed over an active SSH session.
Because only double quotes were escaped and shell command substitution syntax like $(...) remained interpretable, an attacker could inject arbitrary commands into the remote shell when this endpoint was invoked.
Affected context
This vulnerability occurs in the Termix web-based server management platform, specifically within the File Manager component's SSH path resolution functionality.
It is relevant when:
- Termix is used to manage remote servers over SSH
- The /ssh/file_manager/ssh/resolvePath endpoint is accessible to the user (directly or via the UI)
- The backend constructs shell commands using the path parameter and forwards them over an established SSH session
In such deployments, any feature that triggers path resolution on the remote host potentially exposes this injection point.
Exploit preconditions
- Attack surface: HTTP interface of Termix, via GET /ssh/file_manager/ssh/resolvePath
- Required access: Ability to invoke the endpoint with a controlled path parameter (typically an authenticated Termix user with File Manager access)
- Trigger point: Backend processing of the path parameter to build a shell command sent through the existing SSH session
- Why exploitation is possible: The application places the user-controlled path inside double quotes and escapes only double quotes.
Shell command substitution constructs (e.g., $(...) or backticks in some shells) are still evaluated by the remote shell, allowing injected commands to execute in the context of the managed server.
Why this happens
The underlying issue is the construction of shell commands from user input without robust, context-aware sanitization.
Instead of using parameterized or API-level file operations, the backend concatenates the path parameter into a command line and relies solely on escaping double quotes.
This pattern maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, because shell metacharacters for command substitution are not neutralized and remain actionable to the remote shell.
The additional CWE-639 aspect highlights that access control at the application level may not sufficiently constrain which remote resources or sessions can be influenced by a crafted path value.
Potential impact
- Remote execution of arbitrary shell commands on managed servers reachable via Termix
- Unauthorized access to sensitive files and data on those servers
- Installation of backdoors, malware, or persistence mechanisms
- Lateral movement within the target environment using the compromised host as a pivot
- Disruption of services by altering configurations or terminating critical processes
- Possible escalation of privileges if combined with local privilege escalation vulnerabilities
General mitigation guidance
Effective mitigation centers on eliminating shell-based command construction from user input and tightening the trust boundary around remote operations.
Recommended defensive patterns include:
- Avoid building shell commands with user-controlled values; instead, use language-native SSH and file APIs or libraries that do not invoke a shell.
- When remote shell execution is unavoidable, strictly whitelist allowed operations and interpret user inputs as data only (e.g., validated path segments) rather than raw command fragments.
- Normalize and validate paths against an expected format and scope (e.g., restricting to a configured root directory and rejecting metacharacters, command separators, and substitution syntax).
- Apply least-privilege principles to the SSH accounts used by Termix, ensuring they have only the permissions necessary for management tasks.
- Design endpoints so that users operate on logical resources (files, directories, sessions) identified by internal IDs rather than by direct shell-level paths, reducing the impact of CWE-639-style authorization issues.
How teams detect issues like this
Detection typically combines code-centric and behavior-centric approaches:
- Static analysis: Configure rules to flag string interpolation or concatenation of HTTP parameters into shell command invocations (e.g., calls to system, exec, popen, or SSH wrappers that pass a full command line).
- Code review: Look for back-end code that:
- Accepts path or command-like parameters
- Wraps them only in quotes without full shell escaping
- Forwards them to remote shells instead of using structured APIs
- Policy enforcement: Establish coding standards that prohibit shell invocation with untrusted input and require higher-level SSH/file APIs.
- Runtime monitoring: Use logging and security tooling to detect anomalous command patterns, such as unexpected use of $(...), backticks, or command separators in commands initiated from the Termix application.
- Automated tooling: Integrate SAST and DAST tools into CI/CD pipelines to surface OS command injection patterns and validate that HTTP endpoints do not allow shell metacharacters to control execution.

