rootpwn

high · CVSS v3 8.4

CVE-2026-55071

MCP-for-Stata's ado_package_install tool concatenates user input into a Stata command string without sanitization, allowing attackers to inj

Overview

MCP-for-Stata's ado_package_install tool concatenates user input into a Stata command string without sanitization, allowing attackers to inject newline characters and execute arbitrary OS commands. This flaw exists in versions prior to 1.19.0 and can be triggered via the MCP tool or its Python API. The vulnerability enables full OS‑level remote code execution under the server’s user account.

Description

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.

Impact

The flaw compromises confidentiality, integrity, and availability of systems running the vulnerable Stata-MCP server. Attackers can gain full control over the host OS, exfiltrate data, modify files, or disrupt services. Defenders managing Stata-MCP deployments are directly impacted.

Remediation

Upgrade MCP-for-Stata to version 1.19.0 or later, which removes the unsanitized input handling. If an upgrade is not immediately possible, restrict network access to the MCP server, disable the ado_package_install tool, or enforce strict input validation on the package argument. Monitor logs for unexpected Stata command execution.

Risk context

The vulnerability has a high severity rating (CVSS 8.4) and poses a critical risk to any environment running the affected Stata-MCP server. Immediate patching is recommended to prevent potential OS‑level compromise.

Affected products

  • MCP-for-Stata
  • Stata-MCP server
  • Stata

Scores

Severity
high
CVSS v2
7.2
CVSS v3
8.4
CVSS v4
EPSS

RCE command injection Stata MCP high severity input validation patch

← All CVEs