GHSA-xj5p-8h7g-76m7: @translated/lara-mcp vulnerable to command injection in import_tmx tool
SummaryA command injection vulnerability exists in the `@translated/lara-mcp` MCP Server. The vulnerability is caused by the unsanitized use of input parameters within a call to `child_process.exec`, enabling an attacker to inject arbitrary system commands. Successful exploitation can lead to remote code execution under the server process's privileges.The server constructs and executes shell commands using unvalidated user input directly within command-line strings. This introduces the possibility of shell metacharacter injection (`|`, `>`, `&&`, etc.).DetailsThe MCP Server exposes tools to interact with Lara Translate API.  An MCP Client can be instructed to execute additional actions for example via indirect prompt injection in handling (untrusted) sources. Below some example of vulnerable code and different ways to test this vulnerability including an example of indirect prompt injection that can lead to arbitrary command injection.Vulnerable codeThe following snippet illustrates the vulnerable code pattern used in the MCP Server’s tooling.PoCIndirect prompt injectionAn MCP Client can be instructed to execute additional actions for example via indirect prompt injection when handling untrusted sources. The following PoC shows how reading a file (potentially untrusted) can lead to execution of additional tools vulnerable to command injection.When the client reads the file content as part of its contextual input, it may inadvertently interpret injected instructions embedded in file content as legitimate commands or follow-up instructions.This behavior can be exploited to cause the model to execute unintended actions, leading to an arbitrary command execution on the host where the MCP server is running.Create a file `file_to_translate.txt` with contentVerify the file `/tmp/TEST`1 does **not** exist (on the host machine):setup your MCP client IDEOpen the chat and enter the following prompt (it's an example)Observe the `import_tmx` tool execution will be triggered with a malicious payload that can lead to command injection (without user request but just following the instructions in the file):run the `import_tmx` tool (if you have auto run functionality enabled this will be executed without user interaction)Confirm that the injected command executed:Another example (instead of reading a local file) would involve requesting to fetch remote data. In this case, I used a local file to simplify the PoC.Using MCP InspectorOpen the MCP Inspector:In MCP Inspector:set transport type: `STDIO`set the `command` to `npx`set the arguments to `@translated/lara-mcp@latest` (set empty ENV vars needed)click Connectgo to the **Tools** tab and click **List Tools**select the `import_tmx` toolVerify the file `/tmp/TEST` does **not** exist:In the **txm_url** field, input:while in field `id` input `1`Click **Run Tool**Observe the request being sent:Confirm that the injected command executed:RemediationTo mitigate this vulnerability, I suggest to avoid using `child_process.exec` with untrusted input. Instead, use a safer API such as [`child_process.execFile`](https://nodejs.org/api/child_process.html#child_processexecfilefile-args-options-callback), which allows you to pass arguments as a separate array — avoiding shell interpretation entirely.A potential solution could be:ImpactCommand Injection / Remote Code Execution (RCE)Referenceshttps://equixly.com/blog/2025/03/29/mcp-server-new-security-nightmare/https://invariantlabs.ai/blog/mcp-github-vulnerability
CVSS v3.1: 7.5