Skip to content

← Actionable
High, CVSS 7.5amended

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

CVE-2026-77604GHSA-vvr2-h2jp-838m

What to do

Vendor fix available. Upgrade each affected package to the fixed version on its release line (code-graph-rag 0.0.345), redeploy, then verify what is actually installed.

This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.

Affected packages

Sources

Severity and exploitation
Exploitation
No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
CVSS
7.5 · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
EPSS
  • CVE-2026-77604: 0.39% estimated exploitation activity in the next 30 days; percentile 33.58 (FIRST EPSS, 2026-11-10). This is a model estimate, not proof of exploitation or customer exposure.
Source description

As published by the source; long descriptions are shortened.

Summary 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`.

Details 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: ```python

codebase_rag/mcp/tools.py:556-565 async def read_file( self, file_path: str, offset: int | None = None, limit: int | None = None ) ->…

Dates and revisions
Published by the source
Last modified by the source
Source last checked
  1. Revision 3 · amended ·

    Amended from osv record GHSA-vvr2-h2jp-838m

  2. Revision 2 · amended ·

    Amended from osv record GHSA-vvr2-h2jp-838m

  3. Revision 1 · created ·

    Published from ghsa record GHSA-vvr2-h2jp-838m

Agent brief

Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.

# Patch Next advisory brief: CVE-2026-77604

Advisory: Code Graph RAG: MCP paginated read_file path traversal / arbitrary file read
IDs: CVE-2026-77604, GHSA-vvr2-h2jp-838m
Record: https://patchnext.com/advisories/cve-2026-77604 (revision 3, source checked 11 Nov 2026, 07:05 UTC)
Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected.
Severity: High (CVSS 7.5)
Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV.
Vendor response: Vendor fix available; fixed versions by package: code-graph-rag 0.0.345. A vendor fix does not mean a deployment is fixed.

## Affected components
- PyPI code-graph-rag: affected < 0.0.345; fixed in 0.0.345

## Suggested inspection (read-only)
- `python -m pip show code-graph-rag`: prints the installed version. Run with the environment that serves production active.

## Supported action
Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version.

## Required regression checks
- Run the test suite and a production build.
- Exercise the features that depend on code-graph-rag.
- Repeat the inspection and confirm that only fixed versions remain installed.

## Rollback considerations
- Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward.

## Unresolved questions
- Which deployments run an affected version?
- Exploitation status can change. Check again before lowering the priority.
- Mark the work resolved only after the fixed version is verified in production.

## Sources
- Verified: https://github.com/advisories/GHSA-vvr2-h2jp-838m (GitHub-reviewed advisory GHSA-vvr2-h2jp-838m lists affected ranges: PyPI code-graph-rag >=0 <0.0.345)
- Verified: https://osv.dev/vulnerability/GHSA-vvr2-h2jp-838m (OSV record GHSA-vvr2-h2jp-838m lists affected ranges: PyPI code-graph-rag >=0 <0.0.345 (fixed))

Commands are suggestions: review each one before running it.

Loading voting…