Code Graph RAGに任意のファイルを読み取られる脆弱性、0.0.345で修正
Summary
Code Graph RAGのMCPツールread_fileに、パス検証が効かないページ分割の経路があり、認証なしで接続したリモートの攻撃者がサーバー上の任意のファイルを読める脆弱性です。影響は0.0.345より前のバージョンで、0.0.345で修正されています。ネットワークに公開したHTTP版のMCPサーバーを使っている場合は、速やかに0.0.345以降へ更新してください。
AI summary
Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.
Code Graph RAGのMCPツールread_fileに、パス検証が効かないページ分割の経路があり、認証なしで接続したリモートの攻撃者がサーバー上の任意のファイルを読める脆弱性です。影響は0.0.345より前のバージョンで、0.0.345で修正されています。ネットワークに公開したHTTP版のMCPサーバーを使っている場合は、速やかに0.0.345以降へ更新してください。
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| vitali87code-graph-rag | — | Not listed |
| pipcode-graph-rag |
< 0.0.345→ 0.0.345 |
0.0.345 |
| PyPIcode-graph-rag |
< 0.0.345→ 0.0.345 |
0.0.345 |
Original description The description as published by the source.
Code Graph RAG is an AI-powered knowledge graph and retrieval system for querying, understanding, and editing multi-language codebases. Prior to 0.0.345, the MCPToolsRegistry.read_file implementation in codebase_rag/mcp/tools.py joins attacker-controlled file_path input to project_root without resolving and verifying containment when offset or limit selects the paginated branch. An absolute path causes pathlib to discard the configured root, while relative traversal can also resolve outside it. The protected non-paginated branch uses validate_project_path, but the paginated branch bypasses that validation before opening the path. An unauthenticated caller of a network-exposed HTTP MCP server can therefore read arbitrary UTF-8-readable files available to the server process, including credentials, environment data, private keys, source, and configuration; local callers through the stdio transport can reach the same vulnerable code path. This issue is fixed in version 0.0.345.
Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory
References
- advisory github.com
- advisory github.com
- advisory nvd.nist.gov
- package github.com
- patch github.com
- report github.com
- web github.com
- web github.com