# CVE-2026-47708: MCP-for-Stata: Command injection via log_file_name parameter in Stata command wrapper

- Severity: Critical 9.3 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.38%, higher than 34% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-06-04T21:00:42.000Z
- Modified: 2026-10-24T19:10:00.127Z
- Also known as: GHSA-4p62-hqp5-g644, PYSEC-2026-544
- Weaknesses: CWE-77
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total
- Assigned by: GitHub_M

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

(As written by CVE List.)

## Affected

- SepineTam stata-mcp: < 1.17.3
- stata-mcp (PyPI): before 1.17.3

## Every score

- GitHub_M: CVSS:4.0 9.3 Critical `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`
- GitHub: CVSS:4.0 Critical `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`
- PyPA Advisory Database: CVSS:4.0 `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`

## References

- <https://github.com/SepineTam/mcp-for-stata/security/advisories/GHSA-4p62-hqp5-g644> (exploit)
- <https://github.com/SepineTam/mcp-for-stata/issues/74> (web)
- <https://github.com/SepineTam/mcp-for-stata/commit/e6f945941ae0c7cf5e74a428e0b3dc82b396382f> (web)
- <https://github.com/SepineTam/stata-mcp/security/advisories/GHSA-4p62-hqp5-g644> (web)
- <https://github.com/SepineTam/stata-mcp> (package)
- <https://pypi.org/project/stata-mcp> (package)
- <https://github.com/advisories/GHSA-4p62-hqp5-g644> (advisory)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-47708> (advisory)

## Sources

- CVE List: [CVE-2026-47708](https://www.cve.org/CVERecord?id=CVE-2026-47708), CVE Terms of Use, modified 2026-07-22
- GitHub Advisory Database: [GHSA-4p62-hqp5-g644](https://github.com/advisories/GHSA-4p62-hqp5-g644), CC-BY-4.0, modified 2026-06-29
- NVD: [CVE-2026-47708](https://nvd.nist.gov/vuln/detail/CVE-2026-47708), Public domain, modified 2026-10-24
- PyPA Advisory Database: [PYSEC-2026-544](https://osv.dev/vulnerability/PYSEC-2026-544), CC-BY-4.0, modified 2026-07-01

---

Page: https://cve.day/CVE-2026-47708 · Whole record: https://cve.day/CVE-2026-47708.json · Rebuilt by cve.day 2026-11-25T22:59:29.409Z
