# CVE-2026-55071: MCP-for-Stata: Stata Command Injection via Unsanitized `package` in `ado_package_install`

> Attackers can execute arbitrary OS commands by injecting newlines into the package argument of the ado_package_install tool in the Stata MCP server.

- **Severity:** High 8.4 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 21 Sep 2026
- **Updated:** 21 Sep 2026
- **Also known as:** GHSA-49m4-vp58-wgc9, PYSEC-2026-3700

## What is CVE-2026-55071?

CVE-2026-55071 is a high-severity command injection vulnerability in SepineTam mcp-for-stata, published on 21 Sep 2026. It can only be exploited from the same machine or local network, with no action from the victim.

### Official 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.

Weakness: CWE-94 (Improper Control of Generation of Code)

## Which versions are affected by CVE-2026-55071?

3 open source packages ship an affected version, including stata-mcp.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `stata-mcp` | PyPI | All versions | 1.19.0 |
| `stata-mcp` | PyPI | All versions | 1.19.0 |
| `stata-mcp` | PyPI | All versions | 1.19.0 |

## How do I fix CVE-2026-55071?

Upgrade stata-mcp to 1.19.0 or later.

## Is CVE-2026-55071 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-55071 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-55071 and fix it if it is affected.

What it is: CVE-2026-55071 is a high-severity command injection vulnerability in SepineTam mcp-for-stata, published on 21 Sep 2026. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-55071 exists.

Affected packages and fixed versions:
- stata-mcp (PyPI): affected all versions; fixed in 1.19.0
- stata-mcp (PyPI): affected all versions; fixed in 1.19.0
- stata-mcp (PyPI): affected all versions; fixed in 1.19.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-55071/ (Markdown: https://insights.sbomify.com/CVE-2026-55071/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-55071
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-55071
- OSV: https://osv.dev/vulnerability/CVE-2026-55071

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-55071/
Summaries are generated and may contain mistakes; the official description above is the record.
