AAK-MCP-RIPGREP-CVE-2026-113378-001: mcp-ripgrep hands a tool's fileType argument to a shell unescaped (no fixed release)
- Severity
- MEDIUM
- Category
- Supply Chain (
supply-chain) - Scanner
agent_audit_kit/scanners/mcp_cve_pins_2026_07.py- Auto-fixable
- No.
- SARIF name
McpRipgrepFileTypeShellInjection
What it detects
mcp-ripgrep (npm; mcollina/mcp-ripgrep), an MCP server that runs ripgrep for an agent, builds each rg command line as a string and runs it through spawn with shell: true. Its advanced-search and list-files tools append -t ${fileType} to that string as given, where every pattern, path and glob goes through escapeShellArg, so a fileType holding ;, | or $(...) runs a command as the server's user, and an agent that reads untrusted text can be steered into that call (CVE-2026-113378, CVSS 3.1 5.3, CWE-77/CWE-78, GHSA-qq9r-r4m4-c72m). NVD carries VulDB's note that the flaw's existence is doubted and the maintainer's answer, that the README warns the server runs shell commands. The published code decides it: escaping every sibling argument and not this one is an oversight, and a warning is not a fix. Every published version has it, 0.1.0 to 0.4.0 (2025-04-29), the newest; nothing has been pushed since, and there is no fixed release, so this is a presence-only pin.
How to fix
There is no fixed release. Remove the server from agents that read untrusted content, or replace it with a ripgrep MCP server that passes its arguments to execFile or spawn as an array with no shell. Until then keep the advanced-search and list-files tools, whose argument fileType is, out of the model's reach in the client's tool allowlist. Pin the first fixed release once it ships.
To confirm the finding is gone, report only this rule:
agent-audit-kit scan . --rules AAK-MCP-RIPGREP-CVE-2026-113378-001
Limitations
Reports a reference that names mcp-ripgrep: a package.json or lockfile entry, the package an npx launch in an MCP config names, or a config that runs a global install by that bare name. Presence-only: every version is reported, a future fixed one included, until the pin gets a floor. It reads the name, not which tools the client lets the model call. npm's ripgrep-mcp (shk1447/ripgrep-mcp, another server), @vscode/ripgrep and ripgrep are other packages and are not matched; PyPI has no mcp-ripgrep, so a uvx launch is not read; and a source checkout started as node dist/index.js names no package and is not read. 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
- CVE: CVE-2026-113378
- OWASP MCP Top 10: MCP05:2025 (Command Injection & Execution), MCP04:2025 (Software Supply Chain Attacks & Dependency Tampering)
- OWASP Agentic Top 10: ASI04 (Agentic Supply Chain Vulnerabilities), ASI05 (Unexpected Code Execution (RCE))
- Adversa AI MCP Top 25 (AAK-defined ids): ADV-INJECT-01 (Shell Injection via MCP)
- CSA AI Controls Matrix (AICM): AIS-07, STA-08
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-RIPGREP-CVE-2026-113378-001.md: the page then shows that text, with the registry reference appended under it.