CVE-2026-47708 MCP-for-Stata: Command injection via log_file_name parameter in Stata command wrapper
Attackers can execute arbitrary Stata commands via the log_file_name parameter in the MCP-for-Stata server, requiring a patch to prevent code execution.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-47708?
CVE-2026-47708 is a critical command injection vulnerability in SepineTam stata-mcp, published on 21 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
MCP-for-Stata is an MCP server for Stata to integrate Stata into an agent. Prior to version 1.17.3, the `log_file_name` parameter in the `stata_do` API and CLI is directly interpolated into a Stata command string without sanitization. The security guard (`GuardValidator`) only scans the do-file content but does not validate this parameter. An attacker can inject arbitrary Stata commands (including `shell`, `python`, `erase`, etc.) by crafting a malicious `log_file_name` containing quotes, newlines, or Stata command separators. Version 1.17.3 contains a patch for the issue.
Weakness: CWE-77
Which versions are affected by CVE-2026-47708?
3 open source packages ship an affected version, including stata-mcp.
| Package | Affected | Fixed in |
|---|---|---|
stata-mcp PyPI | All versions | 1.17.3 |
stata-mcp PyPI | All versions | 1.17.3 |
stata-mcp PyPI | All versions | 1.17.3 |
How do I fix CVE-2026-47708?
Upgrade stata-mcp to 1.17.3 or later.
Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.
Is CVE-2026-47708 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-47708 exists.
Sources
Also known as GHSA-4p62-hqp5-g644, PYSEC-2026-544.