CVE-2026-31040: Stata mcp Stata-mcp Has Insufficient Validation Of Vulnerability

HIGH
Advisory Identifier: GHSA-jpcj-7wfg-mqxv
CWE-20
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2026-31040
GHSA Identifier GHSA-jpcj-7wfg-mqxv
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-20: Improper Input Validation
Affected Product Stata mcp
Package Ecosystem PyPI
Published Date
Last Updated

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.

stata-mcp fixed: 1.13.0
pip install stata-mcp>=1.13.0
Verify Direct and Transitive Dependencies

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

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.

CVE-2026-31040 Affected Stata mcp Versions

1 component(s)
Fixed Versions:
1.13.0
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?
CVE-2026-31040 is a security vulnerability in Stata mcp involving stata-mcp has insufficient validation of user-supplied Stata do-file content that can lead to command execution under CWE-20: Improper Input Validation.
Which Stata mcp versions are affected?
Affected versions include releases prior to 1.13.0 across affected packages: stata-mcp.
What version fixes CVE-2026-31040?
Upgrading to 1.13.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is stata-mcp affected?
Yes, stata-mcp is affected in releases prior to 1.13.0. Upgrade your dependency to 1.13.0 or later.
What CWE is associated with CVE-2026-31040?
CVE-2026-31040 is classified under CWE-20: Improper Input Validation (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.).
How can I check PyPI dependencies for CVE-2026-31040?
Run the dependency tree command: 'pip show stata-mcp'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}