Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSend malicious Stata do-file to MCP server
-
ExploitParser processes file without validation
-
ExecutionArbitrary commands execute in Stata context
-
ImpactFull system compromise achieved
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Remote unauthenticated attacker can exploit stata-mcp versions prior to v1.13.0 by sending a crafted Stata do-file with malicious commands. The vulnerable server must accept and execute user-supplied do-file content without proper validation. No victim interaction required. |
| Impact | Critical CVSS 9.8 reflects unauthenticated network-accessible remote code execution via malicious Stata do-files. However, EPSS at 0.02% indicates low observed exploitation activity, suggesting limited real-world adoption or exploitation barriers. Patch availability and academic/niche tool scope mitigate blast radius despite severe technical severity. |
| Exploit ScenarioDerived | Attacker crafts malicious Stata do-file with injected commands; user/system processes file through stata-mcp without sanitization, executing arbitrary code with application privileges. No authentication required due to AV:N/PR:N. No public exploit identified at time of analysis. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Apr 08, 2026
Remote code execution via command injection in stata-mcp versions before 1.13.0 allows unauthenticated attackers to execute arbitrary commands through insufficiently validated Stata do-file content. The vulnerability stems from CWE-94 improper control of code generation, enabling network-accessible exploitation without user interaction. CVSS 9.8 (Critical) reflects complete compromise of confidentiality, integrity, and availability. No public exploit identified at time of analysis; low observed exploitation activity (EPSS 0.02%, percentile 6%).
RemediationAI
Vendor-released patch: upgrade to stata-mcp v1.13.0 immediately, available at https://github.com/SepineTam/stata-mcp/releases/tag/v1.13.0. Version 1.13.0 addresses the command injection vulnerability via commit 52413ce (https://github.com/SepineTam/stata-mcp/commit/52413ce) and PR #21 (https://github.com/SepineTam/stata-mcp/pull/21). No workarounds provide equivalent protection; upgrading is mandatory. Identify all instances processing untrusted do-file content and prioritize patching internet-facing deployments. If immediate upgrade is infeasible, discontinue processing external do-file input until patched. Vulnerability details: https://nvd.nist.gov/vuln/detail/CVE-2026-31040 and https://github.com/SepineTam/stata-mcp/issues/20.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
CWE-94 code injection flaw in stata-mcp's do-file parser permits attacker-controlled input to be interpreted as executable commands. CVSS vector AV:N/AC:L/PR:N indicates remotely exploitable with low complexity and no authentication barrier. Vulnerable code inadequately sanitizes user-supplied Stata script content before execution, creating command injection surface.
Know when Stata Mcp gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Primary rating from Vendor (mitre) · only source for this CVE.
CVSS VectorVendor: mitre
Lifecycle Timeline
2DescriptionCVE.org
A vulnerability was identified in stata-mcp prior to v1.13.0 where insufficient validation of user-supplied Stata do-file content can lead to command execution.
Executive ViewAI
CVE-2026-31040 is a critical remote code execution vulnerability in stata-mcp that allows unauthenticated attackers to execute arbitrary commands on systems running vulnerable versions. This affects any organization using stata-mcp for data analysis or statistical workflows, potentially compromising confidential data, analysis integrity, and system availability without requiring user interaction or authentication.
Apply vendor patch to version 1.13.0 or later. If immediate patching is not feasible, implement network segmentation to restrict unauthenticated access to stata-mcp services and disable network-accessible Stata do-file processing until patch is applied.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
EUVD-2026-20475
GHSA-jpcj-7wfg-mqxv
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB