# CVE-2026-47708: SepineTam MCP-for-Stata command injection in log_file_name

Source: https://junglewise.ai/threats/cve-2026-47708-sepinetam-mcp-for-stata-command-injection-in-log-file-name  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-21. Updated: 2026-07-21  
License: CC BY 4.0 with a link back

CVE-2026-47708 · Severity: critical · CVSS 4 · Published 2026-07-21

MCP-for-Stata is a tool used to integrate the Stata statistical software with AI agents and automated workflows. A security flaw allows an attacker to bypass built-in security guards and execute unauthorized commands on the underlying system. This could lead to full system takeover, unauthorized data access, or the deletion of important files.

Technologies: [stata-mcp (PyPI)](https://junglewise.ai/threats/technologies/stata-mcp). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-47708 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-47708 being exploited in the wild.

**How severe is CVE-2026-47708?** Critical severity, with a CVSS score of 4, published 21 July 2026.

**Which products and versions are affected?** stata-mcp (PyPI) < 1.17.3, ECOSYSTEM:introduced=0,fixed=1.17.3.

**Is there a fix for CVE-2026-47708?** Yes. stata-mcp (PyPI): upgrade to 1.17.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-47708 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-47708?** Check whether you run stata-mcp (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- stata-mcp (PyPI): upgrade to 1.17.3 or later

  ```sh
  pip install "stata-mcp>=1.17.3"
  ```


## Technical details

A command injection vulnerability exists in MCP-for-Stata (stata-mcp) prior to version 1.17.3. The root cause is the direct interpolation of the user-supplied `log_file_name` parameter into Stata command strings using Python f-strings within `src/stata_mcp/stata/stata_do/do.py`. While the `GuardValidator` component inspects the content of do-files, it fails to validate parameters passed to the wrapper command. An attacker can use quotes, semicolons, or newlines to break out of the `log using` command context and execute arbitrary Stata commands like `shell`, `python`, or `erase`. This allows for Remote Code Execution (RCE) and path traversal. The issue is fixed in version 1.17.3 by implementing strict regex validation and path resolution checks.

## Affected products

- SepineTam stata-mcp < 1.17.3

## Identifiers

- CVE-2026-47708
- GHSA-4p62-hqp5-g644
- PYSEC-2026-544

## Timeline

- 2026-05-19: disclosed: Issue reported and GHSA advisory published
- 2026-07-21: advisory: CVE published to NVD
- 2026-07-21: patched: Version 1.17.3 released with fix

## References

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

## Related threats

- [stata-mcp Command Injection in ado_package_install](https://junglewise.ai/threats/cve-2026-55071-stata-mcp-command-injection-in-ado-package-install)
- [SepineTam stata-mcp code injection via Stata do-file shell-escape](https://junglewise.ai/threats/cve-2026-31040-sepinetam-stata-mcp-code-injection-via-stata-do-file-shell-escape)
