CVE-2026-87008

Code Graph RAG structural tools follow out-of-root symlinks

Published Nov 5, 2026 CVSS 3.1 · 7.1 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.589, AstGrepService in codebase_rag/tools/ast_grep_service.py enumerates files beneath project_root and relies on should_skip_path in codebase_rag/utils/path_utils.py to classify them, but the containment check operates on unresolved lexical paths. A symbolic link planted inside an analyzed repository can therefore reference a file outside the configured root while still appearing in scope. The structural_search tool follows the link and discloses readable content without an approval gate, while structural_replace with dry_run=False follows it and overwrites writable content; the MCP path invokes structural replacement without the agent-loop approval control. An attacker who causes a victim to analyze a repository containing such a link can read credentials, keys, environment files, or sibling source and can modify files accessible to the code-graph-rag process. This issue is fixed in version 0.0.589.

Analysis

AI-generated

Technical impact

AstGrepService enumerates files under project_root and relies on should_skip_path, but the containment check uses unresolved lexical paths. A symbolic link planted inside the repository can reference a file outside the configured root while still appearing in scope, illustrating a path‑traversal weakness (CWE‑22) and a symbolic‑link traversal flaw (CWE‑59). The structural_search tool follows the link and discloses readable content without an approval gate, while structural_replace with dry_run=False follows it and overwrites writable content. The MCP path triggers structural replacement without the agent‑loop approval control. An attacker who forces a victim to analyze a repository containing such a link can read sensitive files such as credentials, keys, environment files, or sibling source code, or modify files accessible to the code‑graph‑rag process. This vulnerability allows information disclosure and modification of files, potentially leading to data compromise.

Affected Systems

The vulnerability affects the Code Graph RAG system developed by vitali87, specifically the code-graph-rag repository. All releases prior to version 0.0.589 are vulnerable. Versions 0.0.589 and later contain a fix that resolves path resolution and containment checks. No other vendors or products are listed as affected.

Risk and Exploitability

The CVSS score of 7.1 indicates high severity, but the EPSS score is not available, so current exploitation likelihood is unknown. The vulnerability is not listed in the CISA KEV catalog. Exploitation requires an attacker to supply or influence a repository that contains a malicious symbolic link. If the code‑graph‑rag process runs with elevated privileges or has write access to repository files, the attacker can not only read but also overwrite files, potentially enabling further compromise. The attack vector is likely local or remote, depending on how the tool is accessed; an unauthenticated user who can submit a repository for analysis could trigger the exploit. Because the flaw bypasses approval gates, mitigating the risk generally requires infrastructure controls or the vendor patch.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Code Graph RAG to version 0.0.589 or later, which includes the path resolution fix.
  • If an upgrade is not available, run the tool in an environment that disallows symbolic links within the repository and removes any link that points outside the root directory.
  • Ensure the tool executes under a non‑privileged user with limited filesystem permissions, and enforce strict approval gates for structural_search and structural_replace operations.

Generated by OpenCVE AI on November 5, 2026 at 22:06 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-85gg-2gfq-q95m Code Graph RAG structural tools follow out-of-root symlinks
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, '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.589, AstGrepService in codebase_rag/tools/ast_grep_service.py enumerates files beneath project_root and relies on should_skip_path in codebase_rag/utils/path_utils.py to classify them, but the containment check operates on unresolved lexical paths. A symbolic link planted inside an analyzed repository can therefore reference a file outside the configured root while still appearing in scope. The structural_search tool follows the link and discloses readable content without an approval gate, while structural_replace with dry_run=False follows it and overwrites writable content; the MCP path invokes structural replacement without the agent-loop approval control. An attacker who causes a victim to analyze a repository containing such a link can read credentials, keys, environment files, or sibling source and can modify files accessible to the code-graph-rag process. This issue is fixed in version 0.0.589.
Title Code Graph RAG structural tools follow out-of-root symlinks
Weaknesses CWE-22
CWE-59
References
Metrics cvssV3_1

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

Weaknesses
  • CWE-22

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

  • CWE-59

    Improper Link Resolution Before File Access ('Link Following')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Nov 5, 2026, 9:03 PM
Reserved
Sep 8, 2026, 4:44 PM
Status
Deferred
Published
Nov 5, 2026, 9:18 PM
Modified
Nov 12, 2026, 10:18 PM