All vulnerabilities

PyPI

CVE-2026-77604

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

Severity
High 7.5
Published
9 Nov 2026
Last changed
10 Nov 2026
Added to UpHeron
23 Nov 2026
Fixed in
0.0.345
Exploit chance
0.6% in the next 30 daysHigher than 49% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Path traversal (CWE-22)
Attack
Over the network · No login needed · No user action needed
Attacker can
Read data
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Also known as
GHSA-vvr2-h2jp-838m
Sources
OSV.dev and GitHub

Description

The read_file MCP tool in codebase_rag/mcp/tools.py contains a path traversal vulnerability in its paginated branch (when offset or limit is supplied). The handler constructs a file path using Path(self.project_root) / file_path without subsequently validating that the resolved path remains within the configured project root. Python's pathlib silently discards the left-hand component when the right-hand argument is an absolute path, allowing an attacker to read any UTF-8-readable file on the server by passing an absolute path such as /etc/passwd.

Vulnerable location: codebase_rag/mcp/tools.py:556–565 (MCPToolsRegistry.read_file)

The read_file MCP tool accepts three parameters: file_path, offset, and limit. When either offset or limit is present the handler takes a distinct code path:

Because pathlib.Path.truediv replaces the left operand entirely when the right operand is an absolute path, any caller-supplied absolute path (e.g., /etc/passwd, /proc/self/environ) causes full_path…

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
code-graph-ragPyPI · osv:PyPI:code-graph-rag
  • Every version before 0.0.345

About code-graph-rag

Weekly downloads (PyPI)
787PyPI Stats, 24 Nov 2026

Vulnerabilities in code-graph-rag

In our list
2
Published in the last 12 months
2
Critical, last 12 months
0
High, last 12 months
2
Known exploited
0
Search the list for code-graph-rag

References