CVE-2025-54994

CVE-2025-54994 is a critical-severity command injection vulnerability in @akoskm/create-mcp-server-stdio (npm), affecting versions < 0.0.13. It is fixed in 0.0.13.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

@akoskm/create-mcp-server-stdio is vulnerable to MCP Server Command Injection through exec API

Command Injection in MCP Server

The 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.

Vulnerable tool

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.

Vulnerable line of code: https://github.com/akoskm/create-mcp-server-stdio/blob/main/src/index.ts#L24-L40

server.tool("which-app-on-port", { port: z.number() }, async ({ port }) => {
  const result = await new Promise<ProcessInfo>((resolve, reject) => {
    exec(`lsof -t -i tcp:${port}`, (error, pidStdout) => {
      if (error) {
        reject(error);
        return;
      }
      const pid = pidStdout.trim();
      exec(`ps -p ${pid} -o comm=`, (error, stdout) => {
        if (error) {
          reject(error);
          return;
        }
        resolve({ command: stdout.trim(), pid });
      });
    });
  });

Exploitation

When 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.

Reference example from prior security research on this topic:

References and Prior work

  1. Exploiting MCP Servers Vulnerable to Command Injection
  2. Liran's Node.js Secure Coding: Defending Against Command Injection Vulnerabilities

Disclosed by Liran Tal

Impact

User initiated and remote command injection on a running MCP Server.

Untrusted input is inserted into a command that is later executed by the application, allowing the attacker to alter the intent of that command. Typical impact: arbitrary command execution in the application's environment.

Affected versions

@akoskm/create-mcp-server-stdio (< 0.0.13)

Security releases

@akoskm/create-mcp-server-stdio → 0.0.13 (npm)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

  • Don't use exec. Use execFile instead, which pins the command and provides the arguments as array elements.
  • 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.

Frequently Asked Questions

  1. What is CVE-2025-54994? CVE-2025-54994 is a critical-severity command injection vulnerability in @akoskm/create-mcp-server-stdio (npm), affecting versions < 0.0.13. It is fixed in 0.0.13. Untrusted input is inserted into a command that is later executed by the application, allowing the attacker to alter the intent of that command.
  2. Which versions of @akoskm/create-mcp-server-stdio are affected by CVE-2025-54994? @akoskm/create-mcp-server-stdio (npm) versions < 0.0.13 is affected.
  3. Is there a fix for CVE-2025-54994? Yes. CVE-2025-54994 is fixed in 0.0.13. Upgrade to this version or later.
  4. Is CVE-2025-54994 exploitable, and should I be worried? Whether CVE-2025-54994 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  5. What actually determines whether CVE-2025-54994 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  6. How do I fix CVE-2025-54994? Upgrade @akoskm/create-mcp-server-stdio to 0.0.13 or later.

Stop the waste.
Protect your environment with Kodem.