CVE-2026-31040 stata-mcp has insufficient validation of user-supplied Stata do-file content that can lead to command execution
Attackers can execute arbitrary commands via insufficient validation of Stata do-file content in the stata-mcp library.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-31040?
CVE-2026-31040 is a critical code injection vulnerability in n/a, published on 8 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
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.
Weakness: CWE-94
Which versions are affected by CVE-2026-31040?
3 open source packages ship an affected version, including stata-mcp. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
stata-mcp PyPI | All versions | 1.13.0 |
stata-mcp PyPI | All versions | 1.13.0 |
stata-mcp PyPI | All versions | 1.13.0 |
Products include Statamcp Stata-Mcp.
How do I fix CVE-2026-31040?
Upgrade stata-mcp to 1.13.0 or later.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2026-31040 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-31040 exists.
Sources
Also known as GHSA-jpcj-7wfg-mqxv, PYSEC-2026-3076.