Vulnerabilities in pkg:npm/@akoskm/create-mcp-server-stdio

PACKAGE
Advisory Identifier: GHSA-3ch2-jxxc-v4xf
Advisory Summary

CVE-2025-54994 is a CRITICAL @akoskm/create-mcp-server-stdio is vulnerable to mcp vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting @akoskm/create mcp server stdio libraries in the npm ecosystem. The issue involves @akoskm/create-mcp-server-stdio is vulnerable to mcp server command injection through `exec` api. Remediation is available by upgrading affected packages to version 0.0.13.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@akoskm/create-mcp-server-stdio

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@akoskm/create-mcp-server-stdio. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-3ch2-jxxc-v4xf CVE-2025-54994 CRITICAL @akoskm/create-mcp-server-stdio is vulnerable to MCP Server Command Injection through `exec` API

CVE-2025-54994 at a Glance

CVE Identifier CVE-2025-54994
GHSA Identifier GHSA-3ch2-jxxc-v4xf
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product @akoskm/create mcp server stdio
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2025-54994

To remediate this vulnerability, upgrade all affected @akoskm/create mcp server stdio dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@akoskm/create-mcp-server-stdio fixed: 0.0.13
npm install @akoskm/create-mcp-server-stdio@0.0.13
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @akoskm/create-mcp-server-stdio

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2025-54994, inspect your project dependencies using npm:

npm ls @akoskm/create-mcp-server-stdio

Analyze the terminal output to locate any version of @akoskm/create mcp server stdio in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.13), your application is affected.

Note: The npm ls @akoskm/create-mcp-server-stdio command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In @akoskm/create mcp server stdio, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

# 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 ```js 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: ![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) ## Impact User initiated and remote command injection on a running MCP Server. ## Recommendation - 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. ## References and Prior work 1. [Exploiting MCP Servers Vulnerable to Command Injection](https://snyk.io/articles/exploiting-mcp-servers-vulnerable-to-command-injection/) 2. Liran's [Node.js Secure Coding: Defending Against Command Injection Vulnerabilities](https://www.nodejs-security.com/book/command-injection) ## Disclosed by [Liran Tal](https://lirantal.com)

CVE-2025-54994 Affected @akoskm/create mcp server stdio Versions

1 component(s)
Fixed Versions:
0.0.13
Product / Package Ecosystem Affected Versions Fixed Version
@akoskm/create-mcp-server-stdio
npm
< 0.0.13
0.0.13

References

Frequently Asked Questions

What is CVE-2025-54994?
CVE-2025-54994 is a security vulnerability in @akoskm/create mcp server stdio involving @akoskm/create-mcp-server-stdio is vulnerable to MCP Server Command Injection through `exec` API under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which @akoskm/create mcp server stdio versions are affected?
Affected versions include releases prior to 0.0.13 across affected packages: @akoskm/create-mcp-server-stdio.
What version fixes CVE-2025-54994?
Upgrading to 0.0.13 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @akoskm/create-mcp-server-stdio affected?
Yes, @akoskm/create-mcp-server-stdio is affected in releases prior to 0.0.13. Upgrade your dependency to 0.0.13 or later.
What CWE is associated with CVE-2025-54994?
CVE-2025-54994 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check npm dependencies for CVE-2025-54994?
Run the dependency tree command: 'npm ls @akoskm/create-mcp-server-stdio'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-3ch2-jxxc-v4xf",
  "modified" : "2025-09-10T21:03:16Z",
  "published" : "2025-09-08T19:42:34Z",
  "aliases" : [ "CVE-2025-54994" ],
  "summary" : "@akoskm/create-mcp-server-stdio is vulnerable to MCP Server Command Injection through `exec` API",
  "details" : "# 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 }) => {\n  const result = await new Promise<ProcessInfo>((resolve, reject) => {\n    exec(`lsof -t -i tcp:${port}`, (error, pidStdout) => {\n      if (error) {\n        reject(error);\n        return;\n      }\n      const pid = pidStdout.trim();\n      exec(`ps -p ${pid} -o comm=`, (error, stdout) => {\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)",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@akoskm/create-mcp-server-stdio"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.13"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/akoskm/create-mcp-server-stdio/security/advisories/GHSA-3ch2-jxxc-v4xf"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-54994"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/akoskm/create-mcp-server-stdio/pull/1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/akoskm/create-mcp-server-stdio/commit/48c26bbe1f8c62764e4592f33c8300d1cadd2eac"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/akoskm/create-mcp-server-stdio"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/akoskm/create-mcp-server-stdio/blob/main/src/index.ts#L24-L40"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-77", "CWE-78" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-09-08T19:42:34Z",
    "nvd_published_at" : "2025-09-08T20:15:35Z"
  }
}