AAK-MCP-CODEGRAPHRAG-CVE-2026-77604-001: Code Graph RAG below 0.0.345: the MCP read_file tool's paginated branch reads outside the project root
- Severity
- HIGH
- Category
- Supply Chain (
supply-chain) - Scanner
agent_audit_kit/scanners/container_image_pins.py,agent_audit_kit/scanners/mcp_cve_pins_2026_07.py- Auto-fixable
- No.
- SARIF name
CodeGraphRagMcpReadFilePathTraversal
What it detects
Code Graph RAG (PyPI code-graph-rag, vitali87/code-graph-rag) indexes a codebase into a knowledge graph and serves it over MCP (code-graph-rag mcp-server, stdio or HTTP) with tools that read and edit the project's files. Before 0.0.345 the read_file tool's paginated branch, taken when offset or limit is given, joined file_path to the project root without resolving it or checking containment, so an absolute path or .. read any UTF-8 file the server can open, credentials and keys included, for a client, a prompt-injected agent or any caller that reaches the HTTP transport (CVE-2026-77604, CVSS 3.1 7.5, CWE-22, GHSA-vvr2-h2jp-838m). Checked in the PyPI wheels: 0.0.79 to 0.0.100 ship no MCP server (the codebase_rag/mcp package is missing from wheel and sdist), 0.0.148 to 0.0.246 open the joined path, and 0.0.345 resolves it and checks that it stays inside the root. The GHCR image, which runs mcp-server by default, was checked at the commit each tag's label names: 0.0.88, 0.0.99 and 0.0.100 were built from source and carry the server with the flaw.
How to fix
Upgrade code-graph-rag (PyPI or the GHCR image) to 0.0.589 or later and pin it: 0.0.345 fixes this flaw, but 0.0.421 to 0.0.584 carry the structural tools' symlink escape. Until then keep the HTTP transport off networks you do not trust.
To confirm the finding is gone, report only this rule:
agent-audit-kit scan . --rules AAK-MCP-CODEGRAPHRAG-CVE-2026-77604-001
Limitations
Reports code-graph-rag from 0.0.148 below 0.0.345 where a version is stated: a requirements*.txt entry at any depth, a pyproject.toml, Pipfile or lockfile entry at the project root, or a uvx launch in an MCP config, reporting a range that admits an affected version. 0.0.79 to 0.0.100, whose PyPI files hold no MCP server, are not reported. It also reads ghcr.io/vitali87/code-graph-rag tags below 0.0.345 (0.0.88, 0.0.99 and 0.0.100, which were built from source and do carry the server) in compose files, Kubernetes manifests, Helm values, Dockerfiles and MCP configs; latest was the 0.6.30 image on 2026-11-11 and the two-part tag 0.0 the 0.0.996 image, so neither is reported. latest on PyPI was 0.6.30 on 2026-11-11 and states no version, so an unversioned reference is not reported, and neither is the guide's code-graph-rag mcp-server, a global install run by name, or uv run --directory <checkout>, a source checkout. PyPI's codebase-rag is another project and is not matched. It reads the version, not which transport runs or which tools the client lets the model call. 0.0.421 to 0.0.584 are reported by AAK-MCP-CODEGRAPHRAG-CVE-2026-87008-001. 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-77604
- OWASP MCP Top 10: MCP04:2025 (Software Supply Chain Attacks & Dependency Tampering), MCP05:2025 (Command Injection & Execution)
- OWASP Agentic Top 10: ASI02 (Tool Misuse and Exploitation), ASI04 (Agentic Supply Chain Vulnerabilities)
- Adversa AI MCP Top 25 (AAK-defined ids): ADV-INJECT-06 (Tool Param Path Traversal)
- 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-CODEGRAPHRAG-CVE-2026-77604-001.md: the page then shows that text, with the registry reference appended under it.