Skip to content

AAK-MCP-STATA-CVE-2026-47708-001: stata-mcp below 1.19.0 (Stata command injection, two CVEs)

Severity
HIGH
Category
Supply Chain (supply-chain)
Scanner
agent_audit_kit/scanners/mcp_cve_pins_2026_07.py
Auto-fixable
No.
SARIF name
McpForStataCommandInjection

What it detects

MCP-for-Stata (PyPI stata-mcp) reaches OS command execution twice over, by the same route: an unsanitized parameter is concatenated into a Stata command string, and Stata's own shell / python escapes turn that into the operating system. CVE-2026-47708 (< 1.17.3) is the log_file_name parameter of stata_do — the GuardValidator scans only the do-file content, never the parameter. CVE-2026-55071 (< 1.19.0, CVSS 3.1 8.4, GHSA-49m4-vp58-wgc9) is the package parameter of ado_package_install, which is in the default tool profile, so no non-default configuration is required. The command is handed over as an argv element, which stops shell metacharacters and does nothing at all about newline injection into Stata's command language. Fixed in 1.19.0; treat < 1.19.0 (and unpinned) as exposed.

How to fix

Upgrade stata-mcp to >= 1.19.0 and pin it. Allow-list both the log_file_name and package parameters (reject quotes, newlines, and Stata command separators) rather than relying on the do-file content guard or on argv quoting.

To confirm the finding is gone, report only this rule:

agent-audit-kit scan . --rules AAK-MCP-STATA-CVE-2026-47708-001

Limitations

Reads stata-mcp in requirements*.txt at any depth and, at the project root only, in pyproject.toml, Pipfile, package.json, .mcp.json, mcp.json, claude_desktop_config.json and the Pipfile.lock, poetry.lock, uv.lock, package-lock.json, pnpm-lock.yaml and yarn.lock lockfiles, taking the lowest version a range allows and reporting a reference that states no version. The dependency is not read when it is declared in a sub-directory manifest (services/api/pyproject.toml), in .cursor/mcp.json or .vscode/mcp.json, or in a lockfile format the reader does not parse (pdm.lock). A file over 2 MB, or a lockfile over 32 MiB, is not read. A declaration nested more than 64 levels deep in package.json, a TOML manifest or an MCP config (an MCP server more than 62) is still judged, and reported without a line; a lockfile entry keeps its line at any depth.

References


All rules. This page is generated from the rule registry when the documentation is built; to change it, change the rule in agent_audit_kit/rules/builtin.py. To give the rule a hand-written write-up, add docs/rules/AAK-MCP-STATA-CVE-2026-47708-001.md: the page then shows that text, with the registry reference appended under it.