Skip to content

AAK-MCP-CODEGRAPHRAG-CVE-2026-87008-001: Code Graph RAG 0.0.421 to 0.0.584: MCP structural tools follow symlinks out of 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
CodeGraphRagMcpStructuralToolsSymlinkEscape

What it detects

Code Graph RAG (PyPI code-graph-rag, vitali87/code-graph-rag) serves a codebase over MCP (code-graph-rag mcp-server) with structural_search and structural_replace, ast-grep tools that sweep the project's files. Before 0.0.589 their AstGrepService judged each file by its unresolved path, so a symbolic link planted in an analyzed repository passed as inside the root, and structural_search read, and structural_replace with dry_run off overwrote, the file outside it that the link names, with no approval step on the MCP path. Analyzing a repository that holds such a link exposes credentials, keys and other files the server can read or write (CVE-2026-87008, CVSS 3.1 7.1, CWE-22/CWE-59, GHSA-85gg-2gfq-q95m). Checked in the PyPI wheels: AstGrepService first ships in 0.0.421 (0.0.345 has no structural tools), 0.0.584 still compares unresolved paths, and 0.0.589 resolves each path against the resolved root first. The GHCR image, which runs mcp-server by default, was checked at the commit each tag's label names: 0.0.496, 0.0.534 and 0.0.584 carry the flaw and 0.0.639 does not.

How to fix

Upgrade code-graph-rag (PyPI or the GHCR image) to 0.0.589 or later and pin it. Until then do not point the server at a repository you have not checked for symbolic links that leave it, and keep structural_replace on its dry run.

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

agent-audit-kit scan . --rules AAK-MCP-CODEGRAPHRAG-CVE-2026-87008-001

Limitations

Reports code-graph-rag from 0.0.421 below 0.0.589 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. Releases below 0.0.421 have no structural tools and are not reported. The advisory names 0.0.587 as fixed, a version PyPI never carried; 0.0.584 is the last release before 0.0.589. It also reads ghcr.io/vitali87/code-graph-rag tags from 0.0.421 below 0.0.589 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 whether the repositories the server analyzes hold symbolic links or which tools the client lets the model call. 0.0.148 to 0.0.246 are reported by AAK-MCP-CODEGRAPHRAG-CVE-2026-77604-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


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-87008-001.md: the page then shows that text, with the registry reference appended under it.