{"id":"CVE-2025-54994","aliases":["EUVD-2025-27167","GHSA-3ch2-jxxc-v4xf"],"status":"published","title":"@akoskm/create-mcp-server-stdio has Command Injection in MCP Server due to unsafe `exec` API","description":"@akoskm/create-mcp-server-stdio is an MCP server starter kit that uses the StdioServerTransport. Prior to version 0.0.13, the MCP Server is written in a way that is vulnerable to command injection vulnerability attacks as part of some of its MCP Server tool definition and implementation. The MCP Server exposes the tool `which-app-on-port` which relies on Node.js child process API `exec` which is an unsafe and vulnerable API if concatenated with untrusted user input. Version 0.0.13 contains a fix for the issue.","severity":{"version":"4.0","score":9.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"critical","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-12","score":0.01337,"percentile":0.71641,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-77","CWE-78"],"published":"2025-09-08T19:37:42Z","modified":"2026-10-28T02:31:02Z","fixes":[{"ecosystem":"npm","package":"@akoskm/create-mcp-server-stdio","fixed_in":["0.0.13"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"@akoskm/create-mcp-server-stdio","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.0.13"}]}]},{"source":"osv","ecosystem":"npm","package":"@akoskm/create-mcp-server-stdio","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.0.13"}]}]}],"products":[{"vendor":"akoskm","product":"create-mcp-server-stdio"}],"references":[{"url":"https://github.com/akoskm/create-mcp-server-stdio/security/advisories/GHSA-3ch2-jxxc-v4xf","tags":["x_refsource_CONFIRM","advisory","web"]},{"url":"https://github.com/akoskm/create-mcp-server-stdio/commit/48c26bbe1f8c62764e4592f33c8300d1cadd2eac","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/akoskm/create-mcp-server-stdio/blob/main/src/index.ts#L24-L40","tags":["x_refsource_MISC","web"]},{"url":"https://github.com/akoskm/create-mcp-server-stdio/pull/1","tags":["web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-54994","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-3ch2-jxxc-v4xf"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/54xxx/CVE-2025-54994.json","tags":["advisory"]},{"url":"https://github.com/akoskm/create-mcp-server-stdio","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2025-54994","title":"@akoskm/create-mcp-server-stdio has Command Injection in MCP Server due to unsafe `exec` API","description":"@akoskm/create-mcp-server-stdio is an MCP server starter kit that uses the StdioServerTransport. Prior to version 0.0.13, the MCP Server is written in a way that is vulnerable to command injection vulnerability attacks as part of some of its MCP Server tool definition and implementation. The MCP Server exposes the tool `which-app-on-port` which relies on Node.js child process API `exec` which is an unsafe and vulnerable API if concatenated with untrusted user input. Version 0.0.13 contains a fix for the issue.","status":"published","published":"2025-09-08T19:37:42.667Z","modified":"2025-09-08T19:53:45.662Z","cvss":[{"version":"4.0","score":9.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"critical","assessor":"cna"}],"cwes":["CWE-78"],"updated_at":"2026-11-02T14:32:27.603809Z"}],"euvd":[{"id":"EUVD-2025-27167","description":"@akoskm/create-mcp-server-stdio is an MCP server starter kit that uses the StdioServerTransport. Prior to version 0.0.13, the MCP Server is written in a way that is vulnerable to command injection vulnerability attacks as part of some of its MCP Server tool definition and implementation. The MCP Server exposes the tool `which-app-on-port` which relies on Node.js child process API `exec` which is an unsafe and vulnerable API if concatenated with untrusted user input. Version 0.0.13 contains a fix for the issue.","status":"published","published":"2025-09-08T19:37:42Z","modified":"2025-09-08T19:53:45Z","cvss":[{"version":"4.0","score":9.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"critical"}],"updated_at":"2026-11-02T20:31:46.000077Z"}],"ghsa":[{"id":"GHSA-3ch2-jxxc-v4xf","title":"@akoskm/create-mcp-server-stdio is vulnerable to MCP Server Command Injection through `exec` API","description":"# Command Injection in MCP Server\n\nThe MCP Server at https://github.com/akoskm/create-mcp-server-stdio is written in a way that is vulnerable to command injection vulnerability attacks as part of some of its MCP Server tool definition and implementation.\n\n## Vulnerable tool\n\nThe MCP Server exposes the tool `which-app-on-port` which relies on Node.js child process API `exec` which is an unsafe and vulnerable API if concatenated with untrusted user input.\n\nVulnerable line of code: https://github.com/akoskm/create-mcp-server-stdio/blob/main/src/index.ts#L24-L40\n\n```js\nserver.tool(\"which-app-on-port\", { port: z.number() }, async ({ port }) =\u003e {\n  const result = await new Promise\u003cProcessInfo\u003e((resolve, reject) =\u003e {\n    exec(`lsof -t -i tcp:${port}`, (error, pidStdout) =\u003e {\n      if (error) {\n        reject(error);\n        return;\n      }\n      const pid = pidStdout.trim();\n      exec(`ps -p ${pid} -o comm=`, (error, stdout) =\u003e {\n        if (error) {\n          reject(error);\n          return;\n        }\n        resolve({ command: stdout.trim(), pid });\n      });\n    });\n  });\n```\n\n## Exploitation\n\nWhen LLMs are tricked through prompt injection (and other techniques and attack vectors) to call the tool with input that uses special shell characters such as `; rm -rf /tmp;#` (be careful actually executing this payload) and other payload variations, the full command-line text will be interepted by the shell and result in other commands except of `ps` executing on the host running the MCP Server.\n\nReference example from prior security research on this topic:\n\n![Cursor defined MCP Server vulnerable to command injection](https://res.cloudinary.com/snyk/image/upload/f_auto,w_2560,q_auto/v1747081395/Screenshot_2025-05-07_at_9.22.11_AM_d76kvm.png)\n\n## Impact\n\nUser initiated and remote command injection on a running MCP Server.\n\n## Recommendation\n\n- Don't use `exec`. Use `execFile` instead, which pins the command and provides the arguments as array elements.\n- If the user input is not a command-line flag, use the `--` notation to terminate command and command-line flag, and indicate that the text after the `--` double dash notation is benign value.\n\n## References and Prior work\n\n1. [Exploiting MCP Servers Vulnerable to Command Injection](https://snyk.io/articles/exploiting-mcp-servers-vulnerable-to-command-injection/)\n2. Liran's [Node.js Secure Coding: Defending Against Command Injection Vulnerabilities](https://www.nodejs-security.com/book/command-injection)\n\n##\n\nDisclosed by [Liran Tal](https://lirantal.com)","status":"published","published":"2025-09-08T19:42:34Z","modified":"2025-09-10T21:03:17Z","cvss":[{"version":"4.0","score":9.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"critical"}],"cwes":["CWE-77","CWE-78"],"updated_at":"2026-11-02T14:38:57.074217Z"}],"nvd":[{"id":"CVE-2025-54994","description":"@akoskm/create-mcp-server-stdio is an MCP server starter kit that uses the StdioServerTransport. Prior to version 0.0.13, the MCP Server is written in a way that is vulnerable to command injection vulnerability attacks as part of some of its MCP Server tool definition and implementation. The MCP Server exposes the tool `which-app-on-port` which relies on Node.js child process API `exec` which is an unsafe and vulnerable API if concatenated with untrusted user input. Version 0.0.13 contains a fix for the issue.","status":"published","published":"2025-09-08T20:15:35.41Z","modified":"2026-06-17T09:41:04.833Z","cvss":[{"version":"4.0","score":9.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","level":"critical","assessor":"secondary"}],"cwes":["CWE-78"],"updated_at":"2026-11-02T14:11:27.73916Z"}],"osv":[{"id":"CVE-2025-54994","title":"@akoskm/create-mcp-server-stdio has Command Injection in MCP Server due to unsafe `exec` API","description":"@akoskm/create-mcp-server-stdio is an MCP server starter kit that uses the StdioServerTransport. Prior to version 0.0.13, the MCP Server is written in a way that is vulnerable to command injection vulnerability attacks as part of some of its MCP Server tool definition and implementation. The MCP Server exposes the tool `which-app-on-port` which relies on Node.js child process API `exec` which is an unsafe and vulnerable API if concatenated with untrusted user input. Version 0.0.13 contains a fix for the issue.","status":"published","published":"2025-09-08T19:37:42.667Z","modified":"2026-10-28T02:31:02.452074368Z","cvss":[{"version":"4.0","score":9.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"critical"}],"cwes":["CWE-78"],"updated_at":"2026-11-02T15:44:50.863921Z"},{"id":"GHSA-3ch2-jxxc-v4xf","title":"@akoskm/create-mcp-server-stdio is vulnerable to MCP Server Command Injection through `exec` API","description":"# Command Injection in MCP Server\n\nThe MCP Server at https://github.com/akoskm/create-mcp-server-stdio is written in a way that is vulnerable to command injection vulnerability attacks as part of some of its MCP Server tool definition and implementation.\n\n## Vulnerable tool\n\nThe MCP Server exposes the tool `which-app-on-port` which relies on Node.js child process API `exec` which is an unsafe and vulnerable API if concatenated with untrusted user input.\n\nVulnerable line of code: https://github.com/akoskm/create-mcp-server-stdio/blob/main/src/index.ts#L24-L40\n\n```js\nserver.tool(\"which-app-on-port\", { port: z.number() }, async ({ port }) =\u003e {\n  const result = await new Promise\u003cProcessInfo\u003e((resolve, reject) =\u003e {\n    exec(`lsof -t -i tcp:${port}`, (error, pidStdout) =\u003e {\n      if (error) {\n        reject(error);\n        return;\n      }\n      const pid = pidStdout.trim();\n      exec(`ps -p ${pid} -o comm=`, (error, stdout) =\u003e {\n        if (error) {\n          reject(error);\n          return;\n        }\n        resolve({ command: stdout.trim(), pid });\n      });\n    });\n  });\n```\n\n## Exploitation\n\nWhen LLMs are tricked through prompt injection (and other techniques and attack vectors) to call the tool with input that uses special shell characters such as `; rm -rf /tmp;#` (be careful actually executing this payload) and other payload variations, the full command-line text will be interepted by the shell and result in other commands except of `ps` executing on the host running the MCP Server.\n\nReference example from prior security research on this topic:\n\n![Cursor defined MCP Server vulnerable to command injection](https://res.cloudinary.com/snyk/image/upload/f_auto,w_2560,q_auto/v1747081395/Screenshot_2025-05-07_at_9.22.11_AM_d76kvm.png)\n\n## Impact\n\nUser initiated and remote command injection on a running MCP Server.\n\n## Recommendation\n\n- Don't use `exec`. Use `execFile` instead, which pins the command and provides the arguments as array elements.\n- If the user input is not a command-line flag, use the `--` notation to terminate command and command-line flag, and indicate that the text after the `--` double dash notation is benign value.\n\n## References and Prior work\n\n1. [Exploiting MCP Servers Vulnerable to Command Injection](https://snyk.io/articles/exploiting-mcp-servers-vulnerable-to-command-injection/)\n2. Liran's [Node.js Secure Coding: Defending Against Command Injection Vulnerabilities](https://www.nodejs-security.com/book/command-injection)\n\n##\n\nDisclosed by [Liran Tal](https://lirantal.com)","status":"published","published":"2025-09-08T19:42:34Z","modified":"2025-09-10T21:03:16Z","cvss":[{"version":"4.0","score":9.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"critical"}],"cwes":["CWE-77","CWE-78"],"updated_at":"2026-11-02T15:46:35.406455Z"}]}}
