Severity:

HIGH RISK

(7.3)

Command Injection in gmx-vmd-mcp VMD Launch Handler

CVE-2026-7215

Deferred

Vulnerability type

Category:

Command Injection

CWE:

CWE-74, CWE-77

Impact:

Remote Code Execution via Command Injection

Severity:

HIGH RISK

(7.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

gmx-vmd-mcp up to version 0.1.0 contains a command injection vulnerability in the launch_vmd_gui_tool function of mcp_server.py, where the structure_file and trajectory_file arguments are incorporated into a shell command without proper sanitization.

A remote attacker who can influence these arguments may execute arbitrary commands on the hosting system with the privileges of the gmx-vmd-mcp process.

Affected context

The vulnerability occurs in deployments of gmx-vmd-mcp (up to 0.1.0) where the VMD Launch Handler exposes functionality that allows a client to specify or control structure_file and/or trajectory_file parameters.

It typically appears when:

  • The backend constructs shell commands to launch VMD or related tools.
  • User- or network-supplied file paths are passed directly into those shell commands.
  • No strict validation, escaping, or safe process invocation is enforced for these parameters.

The risk is higher in environments where the service is reachable over a network and runs with elevated or shared compute privileges.

Exploit preconditions

  • Attack surface: Network-accessible interface to the VMD Launch Handler (e.g., API endpoint, RPC, or similar mechanism).
  • Required access: Ability to send requests or messages that control structure_file and/or trajectory_file values.
  • Trigger point: Invocation of launch_vmd_gui_tool in mcp_server.py, which uses the supplied values when constructing and executing a command.
  • Why exploitation is possible: The implementation appears to interpolate these arguments directly into a shell command (or equivalent), without rigorous escaping or validation, allowing crafted input to break out of the intended command context and inject additional commands.

Why this happens

This vulnerability stems from constructing shell commands using untrusted input without robust sanitization or safe APIs.

Instead of passing file arguments as isolated parameters to a process execution API, the code likely builds a command string that includes structure_file and trajectory_file directly.

That pattern maps to:

  • CWE-77: Command Injection, where special shell meta-characters in user input alter the structure of the executed command.
  • CWE-74: Improper Neutralization of Special Elements in Output, as the unsafe interpolation fails to neutralize characters that change the intended command.

Conceptually, the bug is treating file path inputs as though they were inert text, when in reality they are interpreted by the shell as executable syntax.

Potential impact

  • Execution of arbitrary OS commands under the permissions of the gmx-vmd-mcp service.
  • Reading, modifying, or deleting files accessible to the service account.
  • Pivoting to other internal systems or services from the compromised host.
  • Installing backdoors or persistent tooling on the affected machine.
  • Disruption of computational workflows, including termination or manipulation of simulations or visualization jobs.

General mitigation guidance

Effective mitigation focuses on eliminating shell interpretation of untrusted input and hardening how external tools are invoked:

  • Use process execution APIs that accept argument lists (e.g., direct exec calls) instead of building shell command strings.
  • Treat all file-related parameters as untrusted and validate them strictly (e.g., whitelisted directories, allowed extensions, normalized paths).
  • Reject or escape shell metacharacters and other control characters in any input that might reach a command context.
  • Apply least-privilege principles so the gmx-vmd-mcp service runs with minimal filesystem and OS permissions.
  • Introduce clear trust boundaries between the network-facing interface and any process-launch functionality, with explicit validation at the boundary.

How teams detect issues like this

Detecting this class of vulnerability and its exploitation can combine code-focused and operational approaches:

  • Static analysis: Flag string-based command constructions that incorporate variables derived from request parameters, especially in mcp_server.py and VMD launch paths.
  • Code review signals: Look for calls that use shell=True, string concatenation or formatting of commands, and any use of user-controlled file parameters in these commands.
  • Policy enforcement: Enforce coding guidelines that mandate argument-list-based process execution and prohibit direct shell interpolation of untrusted input.
  • Runtime monitoring: Monitor process execution logs and system audit trails for unusual commands spawned by the gmx-vmd-mcp process, and for suspicious characters in file arguments.

Sources

SourceLink
github.comgithub.com/egtai/gmx-vmd-mcp/
github.comgithub.com/egtai/gmx-vmd-mcp/issues/2
vuldb.comvuldb.com/submit/802087
vuldb.comvuldb.com/vuln/359815
vuldb.comvuldb.com/vuln/359815/cti

Frequently asked

questions

Yes. The description indicates that the attack may be launched remotely, as long as the attacker can reach the interface that triggers launch_vmd_gui_tool and control the relevant file parameters.

The attacker needs the ability to send crafted input to the component that handles structure_file and trajectory_file (for example, via an API call, RPC message, or similar).

No local shell access is required; logical access to the service interface is sufficient.

Refactor the VMD launch logic to avoid building shell command strings with user-controlled values.

Use process invocation APIs that take an argument list, validate and constrain file parameters, and disallow any shell metacharacters or unexpected path patterns before execution.

Establish and enforce secure coding standards that prohibit shell-based command construction with untrusted data, require strict input validation for all file and path parameters, and integrate automated checks (static analysis and code review templates) to catch command injection patterns before code is merged.

Find out what's already
exploitable in your codebase.