@translated/lara-mcp vulnerable to command injection in import_tmx tool
Discription

image
Summary A 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.). Details The 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 code The following snippet illustrates the vulnerable code pattern used in the MCP Server’s tooling. “`js // https://github.com/translated/lara-mcp/blob/v0.0.11/src/tools/import_tmx.ts#L56-L61 import { exec } from "child_process"; … const execAsync = promisify(exec); …. export async function importTmx(args: any, lara: Translator) { const validatedArgs = importTmxSchema.parse(args); const { id, tmx_content, tmx_url, gzip } = validatedArgs; …. const tempFilePath = path.join(tempDir,…Read More

Back to Main

Subscribe for the latest news: