MCP-for-Stata: Command injection via log_file_name parameter in Stata command wrapper
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Attack requirements
- None
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA and GitHub. Impact type from CWE-77.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- Yes
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| SepineTam | stata-mcp | before 1.17.3 | 1.17.3 | Patch available | CNA |
| — | stata-mcp (PyPI) | before 1.17.3 | 1.17.3 | Patch available | GHSA-4p62-hqp5-g644 |
- stata-mcp VendorSepineTam Affected before 1.17.3 Fixed in 1.17.3 Patch available CNA
- stata-mcp (PyPI) Vendor— Affected before 1.17.3 Fixed in 1.17.3 Patch available GHSA-4p62-hqp5-g644
Remediation
- Fix · CNA stata-mcp (SepineTam) Fixed in 1.17.3
- Fix · GHSA-4p62-hqp5-g644 stata-mcp (PyPI) Fixed in 1.17.3 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2026-47708
- 2026-10-03 Alias added: GHSA-4p62-hqp5-g644
References
Other 5
- 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
- https://github.com/SepineTam/stata-mcp/security/advisories/GHSA-4p62-hqp5-g644
- https://github.com/SepineTam/stata-mcp
More SepineTam vulnerabilities
- TI-2026-39776 MCP-for-Stata: Stata Command Injection via Unsanitized `package` in `ado_package_install` CVSS 3.1HIGH 8.4
Sources
- CVE-2026-47708 · CVE Program
- CVE-2026-47708 · NVD
- FIRST EPSS
- GHSA-4p62-hqp5-g644 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences