CVE-2026-77604

Code Graph RAG: MCP paginated read_file path traversal / arbitrary file read

Published Nov 5, 2026 CVSS 3.1 · 7.5 High EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

The vulnerability is a path traversal flaw in the paginated read_file function of Code Graph RAG’s MCPToolsRegistry. The code concatenates an attacker-controlled file_path with the project root without performing path resolution or containment checks when offset or limit is used. An absolute path can cause pathlib to discard the root configuration, and a relative traversal can resolve outside the intended directory. As a result, an unauthenticated caller can read any UTF‑8‑readable file accessible to the server process, including credentials, environment data, private keys, source code, and configuration files.

Affected Systems

All versions of vitali87:code-graph-rag prior to 0.0.345 are affected. The issue was fixed in release v0.0.345. No other vendors or products are listed as impacted.

Risk and Exploitability

The flaw has a CVSS score of 7.5, indicating high severity, and there is no EPSS score available. It does not appear in the CISA KEV catalog. The likely attack vector is via the network when the HTTP MCP server is exposed; local callers through the standard IO transport can also exploit the same code path. An attacker does not need authentication to read arbitrary files, making the exploitation straightforward if the vulnerable endpoint is reachable.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the latest patch and upgrade to code‑graph‑rag version 0.0.345 or later
  • Restrict or disable the HTTP MCP server or limit its exposure to trusted networks until a patch is deployed
  • If a patch is not immediately available, harden file permissions and reduce the privileges of the running process to limit the reach of the path traversal attack

Generated by OpenCVE AI on November 5, 2026 at 21:39 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-vvr2-h2jp-838m Code Graph RAG: MCP paginated read_file path traversal / arbitrary file read
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Vitali87
Vitali87 code-graph-rag
Vendors & Products Vitali87
Vitali87 code-graph-rag
Type Values Removed Values Added
Description 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.
Title Code Graph RAG: MCP paginated read_file path traversal / arbitrary file read
Weaknesses CWE-22
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N'}

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Nov 9, 2026, 10:51 PM
Reserved
Aug 20, 2026, 8:48 PM
Status
Deferred
Published
Nov 5, 2026, 8:18 PM
Modified
Nov 12, 2026, 10:18 PM