CVE Feed
7.5 High

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

CVE-2026-77604

Summary The readfile MCP tool in codebaserag/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.projectroot) / filepath 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. Details Vulnerable location: codebaserag/mcp/tools.py:556–565 (MCPToolsRegistry.readfile) The readfile MCP tool accepts three parameters: filepath, offset, and limit. When either offset or limit is present the handler takes a distinct code path: python codebaserag/mcp/tools.py:556-565 async def readfile( self, filepath: str, offset: int | None = None, limit: int | None = None ) -> str: logger.info(lg.MCPREADFILE.format(path=filepath, offset=offset, limit=limit)) try: if offset is not None or limit is not None: fullpath = Path(self.projectroot) / filepath # ← VULNERABLE LINE start = offset if offset is not None else 0 with…

Assessment

CVSS
7.5 (v3.1)
Severity
High
EPSS
0.38% chance of exploitation in the next 30 days
Known exploited
Not listed in CISA KEV
Exploit availability
Nothing found in Exploit-DB, Metasploit, Nuclei or public PoC repositories
Published
9 November 2026
Last updated
9 November 2026
Weakness
CWE-22
Assigner
GitHub_M

CVSS vectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

At the source

References

Community proofs of concept

No community proof of concept yet. If you have one for a published vulnerability and the right to share it, add it below — it will appear here once reviewed.

Submit a proof of concept
Before you submit *

Query this programmatically

Agents can read this through the MCP endpoint, or over HTTP:

curl https://cve.zerocrew.in/api/cve/CVE-2026-77604