Quick Take
- What: Command injection vulnerability in code-review-mcp-server MCP tools via unsanitized folderPath and baseBranch parameters
- Severity: High (CVSS 8.7)
- Who is affected: Users running code-review-mcp-server versions before 1.5.3
- Fixed version: 1.5.3
- What to do: Upgrade to code-review-mcp-server version 1.5.3 or later
In plain English
A security flaw in code-review-mcp-server, a tool that automates code review and posts comments on GitHub pull requests, allowed attackers to run any command they wanted on the computer running the server. The problem happened because the tool accepted folder paths and branch names from users and passed them directly to shell commands without checking for dangerous characters. An attacker could type something like main; delete everything as a branch name and the server would execute it. Version 1.5.3 fixes this by passing arguments safely to git and gh commands without using a shell.
What you should do: If you use this tool, you should upgrade immediately. If you don’t use code-review-mcp-server, you can ignore this.
What happened
code-review-mcp-server is an MCP (Model Context Protocol) server that automates code review and can post comments directly on GitHub pull requests. Prior to version 1.5.3, four MCP tools (getLocalGitDiff, codeReview, createPR, and getPRTemplate) accepted caller-controlled folderPath and baseBranch string parameters that were interpolated into command strings executed by child_process.execSync through /bin/sh.
Because these parameters were not sanitized, shell metacharacters, command substitution (such as $(command)), or quote-breaking input could execute arbitrary commands with the privileges of the host process running the MCP server. For example, a baseBranch value of “main; rm -rf ~ #” would execute the rm command after the intended git command.
The vulnerability was reported by security researcher Yinci Chen (123mutouren321414) in issue #56. The maintainer confirmed the command injection and released the fix in version 1.5.3.
What you should do
Upgrade to code-review-mcp-server version 1.5.3 or later. The package is available on npm. There are no workarounds; upgrading is the only mitigation.
What it means
The fix replaces every execSync() call with execFileSync() using argument arrays, so user-controlled MCP tool inputs (folderPath, baseBranch, currentBranch, branchName, filePath) are passed directly to git and gh commands without going through a shell. This eliminates the injection at its root.
In getGitHandler.ts, all git execSync calls were replaced with execFileSync using argument arrays. In cliProvider.ts, all gh execSync calls were replaced with execFileSync, and the jq filename filter is now built via JSON.stringify to ensure attacker-controlled filenames remain safe jq string literals. The fragile denylist helpers escapeShellArg, escapeComment, and formatComment in formatComment.ts were removed as they are no longer needed.
The vulnerability is tracked as CVE-2026-68934 and assigned CWE-78 (Improper Neutralization of Special Elements used in an OS Command). GitHub published security advisory GHSA-jq3q-62jc-fqq9 crediting Yinci Chen as the reporter.
Command injection through MCP tool parameters keeps turning up in AI developer tooling: compare the command execution flaw in the Heym MCP stdio transport and the command injection in GitHub Copilot for JetBrains. New cases are tracked in our AI Security hub.
Sources
NVD entry CVE-2026-68934; GitHub Security Advisory GHSA-jq3q-62jc-fqq9 (Orcus2021/code-review-mcp-server); project issue #56, pull request #57 and commit d116423; release notes v1.5.3.



