Summary
Termix contains an argument-injection flaw in its archive creation endpoint, where selected file names can be interpreted as GNU tar options instead of ordinary operands. A user with access to an SSH file-manager session may cause commands to run on the managed SSH host with the privileges of the connected SSH account.
Affected context
The vulnerability occurs in Termix deployments that use the SSH file manager to create tar-based archives. It becomes risky when users can select files whose basenames begin with option-like characters and the archive-building logic passes those names to tar without an end-of-options marker or an unambiguous relative-path representation.
Exploit preconditions
- Attack surface: The SSH file-manager archive creation endpoint
- Required access: An authenticated user with access to an SSH file-manager session
- Trigger point: Creation of a tar, tar.gz, tar.bz2, or tar.xz archive from selected files
- Why exploitation is possible: Selected basenames are passed to tar as ambiguous command-line operands, allowing specially named files to be interpreted as options and associated actions
Why this happens
The underlying bug is unsafe construction of a command-line argument list for an archive utility. File names are treated as trusted operands even though they may begin with option prefixes, allowing tar to reinterpret attacker-influenced names as command-line options and execute configured actions.
This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, specifically the failure to preserve the intended distinction between data values and command-line syntax.
Potential impact
- An attacker may execute commands on the managed SSH host
- Files accessible to the connected SSH account could be disclosed or modified
- Services or application data may be disrupted
- Credentials, configuration files, or private keys accessible to that account could be exposed
- The affected host could be used for further lateral movement, depending on account privileges
General mitigation guidance
Mitigation generally focuses on ensuring that user-controlled file names remain data rather than command-line syntax.
Common defensive patterns include:
- Use a safe process-execution API with structured argument arrays rather than shell-interpolated command strings
- Terminate command-line option parsing before supplying user-controlled paths
- Represent selected paths as unambiguous relative or absolute operands
- Validate and constrain file selections against the intended SSH directory and authorization policy
- Prefer archive-library APIs that do not invoke external command-line utilities where practical
- Run connected SSH accounts with the minimum filesystem and service privileges required
- Apply filesystem, process, and network restrictions to reduce the impact of command execution
How teams detect issues like this
Detection can combine source review, automated analysis, and runtime monitoring:
- Search for archive utility invocations that concatenate or append user-controlled file names without an end-of-options marker
- Review process-spawning code for shell execution, string-based command construction, and insufficient argument separation
- Add static-analysis or linting rules for unsafe tar invocation patterns and unchecked path operands
- Test archive workflows with option-like file names as part of security-focused regression testing
- Monitor SSH hosts for unexpected tar child processes, unusual command execution, or file changes by service accounts
- Enforce repository policies requiring structured process APIs and explicit validation of file paths

