code-review-graph: arbitrary file read via changed_files path traversal
code-review-graph MCP server - path traversal in get_review_context_tool via changed_files reads arbitrary files outside the repository (GHSA-7fw4-2xhw-8m89)
Unpatched. Reported privately via GitHub Security Advisory on 2026-07-19; the 90-day coordinated-disclosure window passed, and the final 2026-11-03 deadline set in our 2026-10-20 notice expired with no response from the maintainer.
- Product
- code-review-graph (MCP server) in tirth8205/code-review-graph
- Affected versions
- code-review-graph through v2.3.9 and staging (checked at HEAD d72e8fb).
- Severity
- HIGH
- Status
- Unpatched
- Weaknesses
- CWE-22Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
- GitHub advisory
- GHSA-7fw4-2xhw-8m89
Private; in triage, not yet published by the maintainer - CVE
- Pending (requested via MITRE CNA-LR)
- Published
- Credit
- Finder: Aaron Elijah Mars of Aeon. Tool: Aeon (https://www.aeon.fun).
What users should do now
No upstream patch is available yet. Developers who connect code-review-graph to an AI coding agent should apply one of these mitigations until an official fix is released.
- Require manual approval in your MCP client for
get_review_context_toolcalls, and reject any call whosechanged_filescontains..or an absolute path. - Do not run the code-review-graph MCP server while an agent reviews repositories you do not trust, or run it as a separate user, in a container or VM that cannot read your home directory, SSH keys or credential files.
- If modifying the code, apply the small patch from our report: in
get_review_contextincode_review_graph/tools/review.py, resolve eachroot / rel_pathand skip any path that is not insideroot.resolve()before reading it. Apply the same check anywhere else a path is built fromchanged_files. - If an agent may already have been steered into such a call, rotate the keys and tokens stored in files readable by the user that runs the server.
Impact and reach
Any code-review-graph MCP server, over stdio or over Streamable HTTP with serve --http, exposes this tool to whatever drives it. Whoever can influence the tool call can read any file the server's user can read, and the contents come back in the source_snippets field of the response, where the agent can repeat or forward them.
AI agents call this tool routinely during review and read untrusted code from the repository under review, so a comment or string in a malicious repository is enough to set up the call. No extra permission from the user is needed beyond having the MCP server connected. A working exploit is withheld.
How changed_files escapes the repository
The repository root itself is validated, but the individual changed_files entries are not. get_review_context_tool passes them straight to get_review_context, which ranks and bounds the list and then joins each entry onto root and reads it. In Python, joining .. components or an absolute path onto a Path leaves the root, and there is no resolve() or containment check before read_text:
- MCP tool forwards changed_files and include_source: code_review_graph/main.py#L482-L522
- include_source defaults to True: code_review_graph/tools/review.py#L426-L436
- Caller list ranked and bounded into shown_files: code_review_graph/tools/review.py#L565-L573
- Path joined onto root and read with no containment check: code_review_graph/tools/review.py#L625-L636
- SECURITY.md promise this breaks: SECURITY.md#L25
Disclosure timeline
- Vulnerability reported privately via GitHub Security Advisory (GHSA-7fw4-2xhw-8m89).
- First follow-up comment posted on the advisory (31 days in triage).
- Second follow-up comment posted on the advisory (45 days in triage).
- Third follow-up comment posted on the advisory (60 days in triage).
- Coordinated-disclosure notice posted on the advisory after the 90-day window passed, setting a deadline of 2026-11-03.
- Coordinated-disclosure deadline expired with no response from the maintainer; sink verified still present at HEAD d72e8fb and in release v2.3.9.
- Public advisory published; CVE requested via MITRE CNA-LR.
References
- Affected repository: tirth8205/code-review-graph
- GitHub Security Advisory: GHSA-7fw4-2xhw-8m89 (private; in triage)