CVE-2026-47708
Received Received - Intake

Command Injection in MCP-for-Stata

Vulnerability report for CVE-2026-47708, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-07-21

Last updated on: 2026-07-21

Assigner: GitHub, Inc.

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-07-21
Last Modified
2026-07-21
Generated
2026-07-22
AI Q&A
2026-07-22
EPSS Evaluated
N/A
NVD

Affected Vendors & Products

Currently, no data is known.

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-77 The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

MCP-for-Stata is a tool that integrates Stata with an agent system. The vulnerability exists in versions before 1.17.3 where the log_file_name parameter in the stata_do API and CLI is directly inserted into a Stata command without proper sanitization. This allows attackers to inject malicious Stata commands by crafting a log_file_name with quotes, newlines, or command separators.

Detection Guidance

To detect this vulnerability, inspect MCP-for-Stata instances for version 1.17.3 or earlier. Check logs for unusual Stata command execution patterns, especially those involving shell, python, or file operations. Review any log_file_name parameters in API or CLI calls for suspicious inputs like quotes, newlines, or command separators.

Impact Analysis

An attacker could exploit this to execute arbitrary commands on the system running Stata, such as deleting files, running shell or Python commands, or accessing sensitive data. This could lead to data loss, unauthorized access, or system compromise depending on the privileges of the Stata process.

Compliance Impact

This vulnerability could lead to unauthorized data access or modification, violating GDPR's data protection principles or HIPAA's security requirements for protected health information. Organizations using vulnerable versions may face compliance violations, legal penalties, or reputational damage.

Mitigation Strategies

Upgrade MCP-for-Stata to version 1.17.3 or later immediately. If upgrading is not possible, restrict access to the stata_do API and CLI to trusted users only. Monitor logs for any signs of exploitation, such as unexpected Stata commands or file operations.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-47708. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart