Skip to main content

Code Graph RAG CVE-2026-87008

| EUVDEUVD-2026-117781 HIGH
Path Traversal (CWE-22)
2026-11-05 GitHub_M GHSA-85gg-2gfq-q95m
7.1
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Plant symlink to sensitive file inside repository
  2. Delivery
    Victim analyzes repo with code-graph-rag
  3. Exploit
    structural_search/replace checks path lexically only
  4. Execution
    Tool follows symlink outside project root
  5. Impact
    Disclose credentials or overwrite target file

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK

2 techniques across 2 tactics: Discovery, Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that the victim operator run code-graph-rag against a repository the attacker can influence, and that this repository contain a symbolic link whose target lies outside the configured project_root. The read path (structural_search) has NO approval gate at all in AI-orchestrator mode, so the model can trigger it autonomously. The write path (structural_replace with dry_run=False) is nominally protected by a requires_approval flag, but that flag is enforced only by pydantic-ai's agent loop; when invoked over the MCP server path (MCPToolsRegistry.structural_replace) the approval gate is bypassed entirely, so any MCP client that can call tools can overwrite out-of-root files in one shot. Limiting factors that reduce real-world risk: the attack is local (AV:L) and demands user interaction (UI:R) - the victim must choose to analyze untrusted input - and the exposure is bounded by the files readable/writable by the cgr process. No authentication is required by the tool itself (PR:N).

Impact

The CVSS 3.1 vector (AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N = 7.1 High) is internally consistent with the described mechanism: exploitation is local (the attacker does not reach the victim over a network but instead plants a symbolic link inside a source repository), of low complexity, requires no privileges on the target, but does require user interaction - the victim must point code-graph-rag at the attacker-supplied repository. Impact is High confidentiality and High integrity (arbitrary file read via structural_search and arbitrary file overwrite via structural_replace with dry_run=False) with no availability impact, matching C:H/I:H/A:N. On exploitation signals the picture is mixed: the GHSA advisory publishes a full proof-of-concept that was dynamically confirmed to achieve both read and write escape, so working exploit detail is public; however there is NO CISA KEV listing and NO EPSS score in the supplied data, so there is no evidence of active in-the-wild exploitation and no model-based probability to weigh. The vuln.today decision label is 'this_week' (a prioritized-but-not-emergency signal), consistent with a credible, PoC-backed flaw whose exploitation is gated behind social engineering rather than mass remote exploitation. This is a genuine priority for anyone running cgr against untrusted repositories - the tool's core use case - but it is not an internet-facing worm-class issue: the UI:R / AV:L profile means it depends on the victim choosing to analyze attacker-controlled input, which bounds real-world spread toward targeted or supply-chain-style abuse rather than opportunistic scanning. No EPSS data is available to refine that estimate.

Exploit ScenarioDerived

An attacker commits a symbolic link (e.g. linked_module.py pointing at /home/user/.env or an SSH key) into a public or shared repository. A victim runs code-graph-rag (CLI, agentic ask_agent mode, or via an MCP client) to analyze that repository; structural_search follows the link and returns the out-of-root file's contents with no approval gate, and structural_replace with dry_run=False overwrites the real target. A working proof-of-concept demonstrating both the read and write escape is published and dynamically confirmed in the GHSA advisory.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
1 PoC candidate (unverified) Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Nov 05, 2026

Symlink-following in Code Graph RAG before 0.0.589 lets a repository the operator analyzes make the structural_search and structural_replace tools read - and with dry_run=False overwrite - files outside the configured project_root. The path-containment check in should_skip_path is lexical and never resolves the path, so a planted symbolic link whose target lies outside the root is treated as in-scope; structural_search has no approval gate at all, and the requires_approval flag on structural_replace is enforced only by the agent loop, which the MCP tool registry bypasses. The issue is local (AV:L) and requires the victim to analyze an attacker-influenced repository (UI:R), with impact bounded by what the cgr process can read or write; the advisory ships a proof-of-concept reproduction, and the flaw is not listed in CISA KEV.

RemediationAI

Vendor-released patch: upgrade to code-graph-rag 0.0.589 or later (release https://github.com/vitali87/code-graph-rag/releases/tag/v0.0.589), which applies the resolve-then-contain pattern from validate_project_path to should_skip_path so any path whose resolved target escapes the resolved project root is skipped; per the commit at https://github.com/vitali87/code-graph-rag/commit/2648c95aa550ce2d9361a8e75ed669d5f4b451b8 that single change covers both the search and replace paths, and the upstream tests in codebase_rag/tests/test_symlink_containment.py assert that out-of-root links are neither read nor written. The upstream fix additionally suggests skipping symlinked dirents outright in _iter_source_files as defense in depth. Where upgrading is not immediately possible, the compensating control supported by the evidence is to withhold the MCP structural_replace tool from untrusted MCP clients, since the MCP registry bypasses the agent-loop approval flag and permits a one-shot write with dry_run=False - the trade-off is loss of structural replacement through MCP, and structural_search remains ungated and still discloses out-of-root file contents, so running the tool only against repositories whose symlinks have been audited is the remaining limit on exposure until 0.0.589 is deployed.

Affected VersionsENISA

code-graph-rag < 0.0.589

Affected Packages

pypi code-graph-rag fix: 0.0.587, 0.0.589

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The affected component is AstGrepService (codebase_rag/tools/ast_grep_service.py), the backend for the structural_search and structural_replace tools exposed both as agentic AI tools and as MCP tools. It enumerates candidates with os.walk() and filters them only through should_skip_path / _classify_file in codebase_rag/utils/path_utils.py, which computes file_path.relative_to(repo_path) on the unresolved lexical path - it never calls Path.resolve() or Path.is_symlink(). Python's read_text()/write_text() on that path follow the link, so the read sink in search() and the write sink in replace() operate on the real out-of-root target. This maps to CWE-22 (path traversal) with the symlink-specific CWE-59 flavor. The same codebase already applies the correct resolve-then-contain pattern in validate_project_path (codebase_rag/decorators.py) and absolute_path_within_project_root (path_utils.py), whose docstring explicitly warns that unresolved symlinks escape a lexical containment check; AstGrepService simply does not use it. Reachability differs by interface: structural_search carries no requires_approval flag and can be invoked autonomously by the model in orchestrator mode, while structural_replace is marked requires_approval=True but MCPToolsRegistry.structural_replace calls the underlying function directly, so any MCP client able to call tools can trigger the write in one shot.

Know when Code Graph Rag gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 7.1 HIGH
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
vuln.today AI 7.1 HIGH

Local attack via a planted symlink that the victim must analyze (AV:L, UI:R), no privileges needed by the tool, low complexity; arbitrary read and overwrite give C:H/I:H, with no availability impact.

3.1 AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
4.0 AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

Lifecycle Timeline

2
Patch available
Nov 05, 2026 - 21:18 EUVD
CVE Published
Nov 05, 2026 - 20:13 cve.org
HIGH 7.1

DescriptionCVE.org

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.

Technical POC Analysis

CWE-22 (path traversal), with the advisory also tagging CWE-59 (link resolution before file access).

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Latest POC

1 PoC candidate from github (unverified)

Sign in to open the public PoC links collected for this CVE.

Executive ViewAI

Why It Matters

A high-severity flaw in Code Graph RAG (versions before 0.0.589) allows a malicious repository to trick the tool into reading and potentially overwriting files outside its designated project directory. This affects any engineer or automated pipeline that analyzes untrusted or externally sourced code repositories, creating risk of intellectual property exposure and destructive file modification on host systems. Leadership should care because developer workstations and build environments often process third-party code, and a single compromised analysis session could expose sensitive files or corrupt local data.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: run Code Graph RAG in an isolated container or VM with least-privilege filesystem access; mount only the target project directory and keep sensitive data outside that boundary; avoid analyzing untrusted or externally sourced repositories with structural_search or structural_replace; disable or gate the MCP tool registry bypass path; run the tool as a low-privileged OS account to bound read/write impact.

Threat Intelligence Overview

EPSS Score
0.3%
Top 82% exploitable
Prevalence
Low
niche open-source AI code-analysis tool, limited production deployment footprint
Threat Intel
1
1 source
Social Media
1
Sightings
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC Yes
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
Poc
System Exposure· derived
Small
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

56
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +36
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy