VAITP Dataset

← Back to the dataset

CVE-2026-55071

Command injection via newline in package name leads to OS command execution.

  • CVSS 8.4
  • CWE-94
  • Input Validation and Sanitization
  • Remote

MCP-for-Stata is a MCP server for integrating Stata into agent loops with a safety-first design. Prior to version 1.19.0, the ado_package_install MCP tool in stata-mcp concatenates user-controlled input directly into a Stata command string without any validation or sanitization. An attacker who can invoke the MCP tool or the equivalent Python API can embed newline characters in the package argument to inject arbitrary Stata commands. Because Stata supports a shell escape command, this leads to full OS-level arbitrary command execution (RCE) under the account running the Stata-MCP server. The tool is registered in the default all profile, so no non-default configuration is required. This issue has been patched in version 1.19.0.

CVSS base score
8.4
Published
2026-09-21
OWASP
A03 Injection
Orthogonal defect classification
Checking
Code defect classification
Missing Check
Category
Input Validation and Sanitization
Subcategory
Command Injection
Accessibility scope
Remote
Impact
Arbitrary Code Execution
Affected component
MCP-for-Stata
Fixed by upgrading
Yes

Solution

Upgrade MCP‑for‑Stata to version 1.19.0 or later.

Vulnerable code sample

import subprocess

def ado_package_install(package_name: str) -> None:
    """
    Install a Stata ado package via the MCP tool.
    """
    # VULNERABLE: concatenates user input into a command string
    cmd = f"stata-mcp install {package_name}"
    subprocess.run(cmd, shell=True, check=True)

Patched code sample

import subprocess
import shlex

def ado_package_install(package_name: str) -> None:
    """
    Install a Stata ado package via the MCP tool.
    """
    # FIX: sanitizes the package name to prevent command injection
    safe_pkg = shlex.quote(package_name)
    cmd = ["stata-mcp", "install", safe_pkg]
    subprocess.run(cmd, check=True)

Cite this entry

@misc{vaitp:cve202655071,
  title        = {{Command injection via newline in package name leads to OS command execution.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-55071},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-55071/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.