CVE-2026-31040: Stata mcp Stata-mcp Has Insufficient Validation Of Vulnerability
HIGHCVE-2026-31040 is a HIGH stata-mcp has insufficient validation of vulnerability (CWE-20: Improper Input Validation) affecting Stata mcp libraries in the PyPI ecosystem. The issue involves stata-mcp has insufficient validation of user-supplied stata do-file content that can lead to command execution. Remediation is available by upgrading affected packages to version 1.13.0.
CVE-2026-31040 at a Glance
How to Fix CVE-2026-31040
To remediate this vulnerability, upgrade all affected Stata mcp dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install stata-mcp>=1.13.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show stata-mcp
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-31040, inspect your installed packages using pip:
pip show stata-mcp
Analyze the terminal output to locate any version of Stata mcp in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.13.0), your application is affected.
Note: The pip show stata-mcp command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Stata mcp, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-31040 Affected Stata mcp Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
stata-mcp
|
PyPI |
< 1.13.0
|
1.13.0
|
References
Frequently Asked Questions
What is CVE-2026-31040?
Which Stata mcp versions are affected?
What version fixes CVE-2026-31040?
Is stata-mcp affected?
What CWE is associated with CVE-2026-31040?
How can I check PyPI dependencies for CVE-2026-31040?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-jpcj-7wfg-mqxv",
"modified" : "2026-04-08T19:24:12Z",
"published" : "2026-04-08T18:34:06Z",
"aliases" : [ "CVE-2026-31040" ],
"summary" : "stata-mcp has insufficient validation of user-supplied Stata do-file content that can lead to command execution",
"details" : "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.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "stata-mcp"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.13.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-31040"
}, {
"type" : "WEB",
"url" : "https://github.com/SepineTam/stata-mcp/issues/20"
}, {
"type" : "WEB",
"url" : "https://github.com/SepineTam/stata-mcp/pull/21"
}, {
"type" : "WEB",
"url" : "https://github.com/SepineTam/stata-mcp/commit/52413ce"
}, {
"type" : "WEB",
"url" : "https://github.com/SepineTam/stata-mcp/releases/tag/v1.13.0"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/sepinetam/stata-mcp"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-08T19:24:12Z",
"nvd_published_at" : "2026-04-08T16:16:22Z"
}
}