Code Graph RAG structural tools follow out-of-root symlinks
CVE-2026-87008 · GHSA-85gg-2gfq-q95m · published 2026-11-09
- Severity
- High
- CVSS score
- 7.1
- Chance of exploitation (EPSS)
- 0.26%
- Fixed in
- Not on PyPI
- Exploitation Public proof of concept
- Automatable No
- Technical impact Total
- CISA SSVC
Any operator who points cgr (CLI, agentic ask_agent mode, or MCP structural_search/structural_replace tools) at a repository they did not fully audit -- the exact use case this tool is built for ("query, understand, and edit multi-language codebases") -- can have that repository's planted symlink used to: Disclose the contents of any file readable by the cgr process (credentials, SSH keys, .env files, sibling project source), via structural_search, with no approval gate at all. Overwrite the contents of any file writable by the cgr process, via structural_replace(dry_run=False), bypassing the tool's own approval gate when called through the MCP protocol.
PyPI does not serve the fixed version this advisory names for code-graph-rag (0.0.587). The newest release on PyPI when checked on 2026-12-06 was 0.7.180; the advisory does not list it as affected.
Apply the same resolve-then-contain pattern already used by validate_project_path (codebase_rag/decorators.py:73-75) and absolute_path_within_project_root (codebase_rag/utils/path_utils.py:156-176) to should_skip_path. Concretely: this one change in should_skip_path fixes both _classify_file (search) and the os.walk filtering in _iter_source_files (replace), since both route through it. As defense in depth, _iter_source_files could additionally skip symlinked dirents outright (entry.is_symlink()) during the os.walk. Credit: Dostxodjayev Abdullox (GitHub: squeeze440)
| Package | Registry | Affected | Fixed in |
|---|---|---|---|
| code-graph-rag | PyPI | <= 0.0.586 | 0.0.587 (not on PyPI) |
- CriticalMCP Path Traversal Allows Full-Filesystem Read and JWT Secret Exfiltration Leading to Account Takeoverlangflow, langflow-base
- CriticalVibe-Trading FastAPI endpoints permit unauthenticated access, file upload, and an RCE chainvibe-trading-ai
- Critical@zereight/mcp-gitlab: Unauthenticated arbitrary file read via `upload_markdown` enables PAT exfiltration and full account takeover@zereight/mcp-gitlab
- CriticalFlowise RCE via SQL Database Chain Nodeflowise, flowise-components
- CriticalLangroid: SQLChatAgent dangerous-function blocklist can be bypassed with quoted or schema-qualified pg_read_file callslangroid
- Criticalfast-mcp-telegram: Bearer token path traversal bypasses reserved Telegram session protectionfast-mcp-telegram
The impact, patch and workaround text comes from the advisory, shortened (GitHub Advisory Database, CC BY 4.0). Proof-of-concept and reproduction sections and code are left out; the original advisory has them.