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
- Affected
- vitali87 · code-graph-rag · code-graph-rag
- 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
- https://github.com/vitali87/code-graph-rag/security/advisories/GHSA-vvr2-h2jp-838m
- https://nvd.nist.gov/vuln/detail/CVE-2026-77604
- https://github.com/vitali87/code-graph-rag/commit/6541e920a27961fa8f3ff49ef38c0e0bd09cd626
- https://github.com/vitali87/code-graph-rag/releases/tag/v0.0.345
- https://github.com/advisories/GHSA-vvr2-h2jp-838m
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
Only for publicly disclosed vulnerabilities, and only material from testing you were authorised to perform. This platform does not buy, sell, or broker exploits — see earning from vulnerability research for legitimate bounty programs. Submissions are reviewed before they appear. Text only; do not include live credentials, personal data, or anything targeting systems you are not permitted to test.
Query this programmatically
Agents can read this through the MCP endpoint, or over HTTP:
curl https://cve.zerocrew.in/api/cve/CVE-2026-77604