Vitali87 code-graph-rag
Code Graph RAG: MCP paginated read_file path traversal / arbitrary file read
Code Graph RAG is an AI-powered knowledge graph and retrieval system for querying, understanding, and editing multi-language codebases. Prior to 0.0.345, the MCPToolsRegistry.read_file implementation in codebase_rag/mcp/tools.py joins attacker-controlled file_path input to project_root without resolving and verifying containment when offset or limit selects the paginated branch. An absolute path causes pathlib to discard the configured root, while relative traversal can also resolve outside it. The protected non-paginated branch uses validate_project_path, but the paginated branch bypasses that validation before opening the path. An unauthenticated caller of a network-exposed HTTP MCP server can therefore read arbitrary UTF-8-readable files available to the server process, including credentials, environment data, private keys, source, and configuration; local callers through the stdio transport can reach the same vulnerable code path. This issue is fixed in version 0.0.345.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- < 0.0.345
Fixed in 0.0.345
Mitigation
Upgrade code-graph-rag to 0.0.345 or later.
References
- Vendor advisory github.com/vitali87/code-graph-rag/security/ad…
- Patch github.com/vitali87/code-graph-rag/commit/6541…
- Release notes github.com/vitali87/code-graph-rag/releases/ta…
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.
Other public exploits
Exploit-DB, Metasploit and nuclei count as public PoCs. Exploit-tagged references from the CVE record and NVD are links only. None of these are analysed by us.| Source | Title | Published | Found by us |
|---|---|---|---|
| CVE record (tagged exploit) | https://github.com/openemr/openemr/security/advisories/GHSA-5h9g-m7q2-pv45 | unknown | 14 Nov 2026 |