CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-68934

CVE-2026-68934: OS Command Injection in code-review-mcp-server via Unsafe Shell Execution

Alon Barad
Alon Barad
Software Engineer

Nov 17, 2026·11 min read·2 visits

Executive Summary (TL;DR)

Versions of code-review-mcp-server prior to 1.5.3 concatenate unsanitized MCP tool arguments into shell strings executed by child_process.execSync(). Attackers or indirect prompt injections can supply shell metacharacters in parameters like folderPath and baseBranch to achieve arbitrary command execution on the host system.

A remote OS command injection vulnerability (CWE-78) exists in code-review-mcp-server prior to version 1.5.3. The application passes caller-controlled tool parameters directly into Node.js child_process.execSync() calls without proper neutralization. An attacker or compromised LLM agent invoking tools such as getLocalGitDiff, codeReview, createPR, or getPRTemplate can inject arbitrary shell commands that execute with the privileges of the MCP server host process.

Vulnerability Overview

code-review-mcp-server is an open-source Model Context Protocol (MCP) server distributed via the npm ecosystem (Orcus2021/code-review-mcp-server). It enables Large Language Models (LLMs) and AI coding assistants—such as Claude Desktop, Cursor, and Continue—to automate code reviews, inspect local Git repositories, and post review comments directly onto GitHub Pull Requests. To perform these operations, the server exposes several JSON-RPC tools that interact with the local git executable and the GitHub CLI (gh).

In versions prior to 1.5.3, the server fails to neutralize special elements within caller-controlled parameters before passing them to operating system command interpreters (classified under CWE-78: OS Command Injection). Specifically, MCP tool endpoints including getLocalGitDiff, codeReview, createPR, and getPRTemplate accept string arguments validated only for basic type conformance via Zod (z.string()). These arguments—such as folderPath, baseBranch, currentBranch, branchName, and filePath—are interpolated directly into template strings and passed to Node.js's child_process.execSync() function.

Because execSync() invokes the underlying system shell (/bin/sh on Unix-like systems or cmd.exe on Windows) to parse and execute the provided command string, any shell metacharacters present in the tool parameters are evaluated by the shell interpreter. Furthermore, secondary helper functions designed to sanitize GitHub comment bodies rely on an incomplete character denylist, while dynamic jq queries interpolate raw file paths directly into filter strings.

An attacker who can issue tool execution requests to the MCP server, or an external adversary who triggers an indirect prompt injection while an AI assistant reviews an untrusted repository or pull request, can supply maliciously crafted branch names or directory paths. This results in arbitrary command execution with the full privileges of the user or service account running the code-review-mcp-server process.

Root Cause Analysis

The root cause of CVE-2026-68934 is the architectural reliance on shell string construction via child_process.execSync() rather than parameterized process execution via child_process.execFileSync(). In Node.js, execSync(command) spawns a subshell (/bin/sh -c on POSIX platforms or cmd.exe /d /s /c on Windows) and delegates argument splitting, environment variable expansion, subshell evaluation, and command chaining to that shell.

Across src/utils/getGitHandler.ts and src/utils/githubProvider/cliProvider.ts, user-controlled parameters are incorporated into shell commands through four distinct vulnerable patterns. The first pattern is completely unquoted string interpolation. In functions such as getFileChanges, fetchSpecificBranch, and checkBranchPushedToRemote, parameters like baseBranch, currentBranch, and branchName are inserted directly into the command string without surrounding quotation marks or character escaping. If an input contains whitespace or shell control operators (;, |, &), the shell immediately terminates the git command and executes the subsequent tokens as separate commands.

The second pattern involves fragile double-quote wrapping. Parameters such as folderPath and filePath are enclosed in double quotes within the template string (e.g., git -C "${folderPath}" rev-parse HEAD). However, no validation prevents the caller from supplying a literal double quote (") within folderPath to close the quoted context prematurely and append arbitrary shell commands. Additionally, within POSIX /bin/sh, double quotes do not inhibit command substitution via $() or backticks (`...`), meaning subshells execute even without breaking out of the quotation marks.

The third and fourth patterns reside in the GitHub CLI integration (src/utils/githubProvider/cliProvider.ts) and comment formatting utility (src/utils/formatComment.ts). The server attempted to sanitize pull request titles, bodies, and comments using a custom escapeShellArg() function that only escaped ", `, and $. This denylist omitted backslash (\) escaping—allowing an attacker to supply \" to escape the backslash itself and leave the quote unescaped—and failed to handle newline characters or other shell constructs when unquoted. Simultaneously, cliProvider.ts interpolated raw pull request filenames into a --jq filter string executed by gh api, enabling both shell injection and jq filter expression injection.

Code Analysis: Vulnerable Implementation vs. Patch

A code-level inspection of the repository prior to version 1.5.3 reveals multiple command injection sinks across three primary files: src/utils/getGitHandler.ts, src/utils/formatComment.ts, and src/utils/githubProvider/cliProvider.ts.

In src/utils/getGitHandler.ts, functions responsible for querying local repository state used template literals inside execSync(). Below is the vulnerable implementation of getFileChanges, fetchSpecificBranch, and getFileDiff:

// Vulnerable code in src/utils/getGitHandler.ts (< 1.5.3)
import { execSync } from 'child_process';
 
const getFileChanges = (
  folderPath: string,
  baseBranch: string,
  currentBranch: string,
): FileChange[] => {
  // SINK 1: folderPath allows quote breakout or $() substitution;
  // baseBranch and currentBranch are completely unquoted.
  const numstatOutput = execSync(
    `git -C "${folderPath}" diff --numstat ${baseBranch}..${currentBranch}`,
    { encoding: 'utf-8' },
  ).trim();
  // ...
};
 
export const fetchSpecificBranch = (folderPath: string, branchName: string): boolean => {
  try {
    // SINK 2: Unquoted branchName concatenated into git fetch
    execSync(`git -C "${folderPath}" fetch origin ${branchName}`, {
      encoding: 'utf-8',
    });
    return true;
  } catch {
    return false;
  }
};

In src/utils/formatComment.ts and src/utils/githubProvider/cliProvider.ts, the application attempted manual shell escaping before invoking gh pr create and gh api:

// Vulnerable code in src/utils/formatComment.ts (< 1.5.3)
export function escapeShellArg(arg: string) {
  // Incomplete sanitization: does not escape backslashes (\), allowing \" breakout.
  return arg.replace(/"/g, '\\"').replace(/`/g, '\\`').replace(/\$/g, '\\$');
}
 
// Vulnerable code in src/utils/githubProvider/cliProvider.ts (< 1.5.3)
for (const file of files) {
  // SINK 3: file.path comes from an untrusted GitHub PR and is interpolated
  // directly into both a shell string (wrapped in single quotes) and a jq filter.
  const patch = execSync(
    `gh api repos/${owner}/${repo}/pulls/${prNumber}/files --jq '.[] | select(.filename == "${file.path}") | .patch'`,
  ).toString();
}

In commit d11642322b607556affaaa3fd631d4f8942c05d8 (merged in Pull Request #57), the maintainer remediated the vulnerability by replacing all execSync imports with execFileSync. When using execFileSync(file, args, options), Node.js executes the binary directly via execve(2) (or CreateProcessW on Windows) with an explicit array of argument strings, bypassing /bin/sh entirely. Additionally, the flawed escapeShellArg function was deleted, and JSON.stringify(file.path) was introduced to safely encode filenames inside the jq selector:

// Patched code in src/utils/getGitHandler.ts (1.5.3)
import { execFileSync } from 'child_process';
 
const getFileChanges = (
  folderPath: string,
  baseBranch: string,
  currentBranch: string,
): FileChange[] => {
  // FIX: Arguments are passed as an array to execFileSync; no shell is spawned.
  const numstatOutput = execFileSync(
    'git',
    ['-C', folderPath, 'diff', '--numstat', `${baseBranch}..${currentBranch}`],
    { encoding: 'utf-8' },
  ).trim();
  // ...
};
 
// Patched code in src/utils/githubProvider/cliProvider.ts (1.5.3)
for (const file of files) {
  // FIX: execFileSync prevents shell evaluation, and JSON.stringify ensures
  // file.path cannot break out of the jq string literal.
  const patch = execFileSync('gh', [
    'api',
    `repos/${owner}/${repo}/pulls/${prNumber}/files`,
    '--jq',
    `.[] | select(.filename == ${JSON.stringify(file.path)}) | .patch`,
  ]).toString();
}

> [!NOTE] > Fix Completeness & Variant Analysis: Switching to execFileSync completely eliminates OS command injection via shell metacharacters (;, |, &, $(), backticks). However, passing untrusted strings directly into git and gh argument arrays without validating against leading hyphens (-) leaves theoretical exposure to Argument/Option Injection (CWE-88) in specific subcommands where positional arguments are not preceded by the -- end-of-options delimiter (for example, git fetch origin <branchName> or git rev-parse <branchName>). While getFileDiff properly includes '--' before filePath, adding -- or validating that branch names do not begin with - is recommended for defense-in-depth.

Exploitation Methodology & Proof of Concept

Exploitation of CVE-2026-68934 requires an attacker to trigger an MCP tools/call JSON-RPC request containing malicious parameters to a running instance of code-review-mcp-server. In practice, this occurs through two primary deployment scenarios: direct invocation by an attacker with network/transport access to an exposed MCP server (e.g., over SSE/HTTP), or indirect prompt injection against an AI coding assistant connected to the server over local stdio.

In an indirect prompt injection scenario, a developer instructs their LLM client to review a third-party repository or an untrusted pull request. Hidden instructions embedded within commit messages, PR descriptions, or source code comments direct the LLM to invoke getLocalGitDiff or codeReview with a crafted baseBranch or folderPath argument. If the MCP client executes the tool call without human approval (or if the user approves a benign-looking tool request), the payload executes immediately on the developer's workstation.

Three distinct proof-of-concept vectors demonstrate how different parameter contexts are exploited:

// PoC 1: Semicolon Command Chaining via Unquoted `baseBranch`
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "getLocalGitDiff",
    "arguments": {
      "folderPath": "/path/to/valid/repo",
      "baseBranch": "main; touch /tmp/pwned_semicolon #",
      "currentBranch": "HEAD"
    }
  }
}

When processing PoC 1, getFileChanges constructs the command string git -C "/path/to/valid/repo" diff --numstat main; touch /tmp/pwned_semicolon #..HEAD. The /bin/sh interpreter executes the git diff command, immediately runs touch /tmp/pwned_semicolon, and treats #..HEAD as a shell comment.

// PoC 2: Subshell Command Substitution via `baseBranch`
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "codeReview",
    "arguments": {
      "folderPath": "/path/to/valid/repo",
      "baseBranch": "$(touch /tmp/pwned_subshell)",
      "currentBranch": "HEAD"
    }
  }
}
// PoC 3: Double-Quote Breakout via `folderPath`
{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "getLocalGitDiff",
    "arguments": {
      "folderPath": "/tmp/dummy\" ; touch /tmp/pwned_quote ; #",
      "baseBranch": "main",
      "currentBranch": "HEAD"
    }
  }
}

In PoC 3, the server first validates the repository path by calling checkIsGitRepo(folderPath), which runs git -C "/tmp/dummy" ; touch /tmp/pwned_quote ; #" rev-parse --is-inside-work-tree. Because checkIsGitRepo executes before branch validation, the injected payload runs even if /tmp/dummy is not a valid Git repository.

Impact Assessment

Successful exploitation of CVE-2026-68934 grants the attacker arbitrary operating system command execution within the security context of the Node.js process running code-review-mcp-server. Because this MCP server is designed to interact with local Git repositories and the GitHub CLI (gh), the host environment almost invariably contains high-value credentials.

Specifically, code-review-mcp-server requires either a pre-authenticated gh CLI session or a GITHUB_TOKEN environment variable configured with permissions to read pull requests and post review comments. An attacker achieving command execution can immediately dump process environment variables, extract GitHub Personal Access Tokens (PATs) from ~/.config/gh/hosts.yml or the system keyring, read SSH private keys from ~/.ssh/, and modify local source code or Git hooks to establish persistent execution.

GitHub, Inc. (the assigning CNA) scored this vulnerability under CVSS v4.0 at 8.7 (High) with the vector CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N. The Attack Vector is rated Network (AV:N) with Low Attack Complexity (AC:L) and No Attack Requirements (AT:N), reflecting that MCP servers can be accessed across transport boundaries without specialized conditions. Privileges Required is Low (PR:L), indicating that the caller must be authorized to invoke the MCP server's tools, and User Interaction is None (UI:N).

Confidentiality, Integrity, and Availability impacts on the vulnerable system are all rated High (VC:H/VI:H/VA:H) due to complete compromise of the host user account. As of the latest threat intelligence data, CVE-2026-68934 is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog and holds an EPSS score of 0.00427 (0.43%, 37.52nd percentile).

Remediation & Mitigation Guidance

The primary remediation for CVE-2026-68934 is to upgrade code-review-mcp-server to version 1.5.3 or later. Version 1.5.3 replaces all instances of child_process.execSync() with child_process.execFileSync() and encodes file paths inside jq filters using JSON.stringify(), neutralizing shell metacharacter injection.

Administrators and developers who install the package globally or within project dependencies should update it via npm:

npm install -g code-review-mcp-server@1.5.3

For users invoking the server dynamically via npx inside MCP client configuration files (such as claude_desktop_config.json or .cursor/mcp.json), the configuration must be pinned to 1.5.3 or updated to ensure cached versions prior to 1.5.3 are not executed:

{
  "mcpServers": {
    "code-review": {
      "command": "npx",
      "args": ["-y", "code-review-mcp-server@1.5.3"]
    }
  }
}

If immediate upgrading is not feasible, organizations should apply defense-in-depth mitigations:

  1. Require Explicit Tool Approval (Human-in-the-Loop): Configure the MCP client to disable automatic tool execution (autoApprove) for getLocalGitDiff, codeReview, createPR, and getPRTemplate. Verify that folderPath, baseBranch, and currentBranch do not contain shell metacharacters (;, |, &, $, `, ") before approving tool calls.
  2. Containerization / Sandboxing: Run the MCP server inside an isolated container or restricted sandbox with read-only mounts limited strictly to the target repository directory and scoped, short-lived GitHub tokens.
  3. Endpoint Detection and Response (EDR) Monitoring: Monitor process creation events where a node process executing code-review-mcp-server spawns /bin/sh -c or cmd.exe /d /s /c. In patched versions (&gt;= 1.5.3), node spawns git and gh directly as child processes without an intermediate shell.

Official Patches

Orcus2021Pull Request #57 replacing execSync with execFileSync and adding regression tests.
Orcus2021Official release v1.5.3 containing the fix for CVE-2026-68934.
GitHubGitHub Security Advisory GHSA-jq3q-62jc-fqq9.

Fix Analysis (1)

Technical Appendix

CVSS Score
8.7/ 10
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
EPSS Probability
0.43%
Top 62% most exploited

Affected Systems

code-review-mcp-server (npm package)

Affected Versions Detail

Product
Affected Versions
Fixed Version
code-review-mcp-server
Orcus2021
< 1.5.31.5.3
AttributeDetail
CVE IDCVE-2026-68934 (GHSA-jq3q-62jc-fqq9)
Vulnerability ClassCWE-78: OS Command Injection
CVSS v4.0 Score8.7 High (CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N)
EPSS Score0.43% (37.52nd Percentile)
Affected Componentcode-review-mcp-server (< 1.5.3)
Patched Version1.5.3
Exploit StatusPublic PoC Available
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1059Command and Scripting Interpreter
Execution
CWE-78
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

The software constructs an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.

Known Exploits & Detection

GitHubOriginal vulnerability disclosure and technical proof-of-concept report by Yinci Chen demonstrating command injection via baseBranch and folderPath.

Vulnerability Timeline

Vulnerability reported in GitHub Issue #56 by researcher Yinci Chen with PoC documentation.
2026-04-10
Patch commit d11642322b607556affaaa3fd631d4f8942c05d8 authored and merged via Pull Request #57.
2026-07-06
Patched version 1.5.3 released to npm and GitHub Security Advisory GHSA-jq3q-62jc-fqq9 published.
2026-07-06
Reporter requested official CVE assignment for GHSA-jq3q-62jc-fqq9.
2026-07-17
CVE-2026-68934 officially published by GitHub CNA and populated in NVD.
2026-11-16

References & Sources

  • [1]GitHub Security Advisory GHSA-jq3q-62jc-fqq9
  • [2]Official CVE-2026-68934 Record (CVE.org)
  • [3]National Vulnerability Database (NVD) - CVE-2026-68934
  • [4]GitHub Issue #56: Original Vulnerability Report and PoC
  • [5]GitHub Pull Request #57: Remediation PR
  • [6]Official Fix Commit d11642322b607556affaaa3fd631d4f8942c05d8
  • [7]Release Tag v1.5.3
  • [8]CVE v5 JSON Advisory Record

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•less than a minute ago•CVE-2026-119351
6.3

CVE-2026-119351: Cross-Context Cache Leak via Delayed Inner Stream Metadata in Next.js

A race condition and improper synchronization vulnerability (CWE-362) exists in Next.js versions 16.2.0 prior to 16.4.5 when Cache Components ('use cache' directive) are enabled. When an outer cached function calls a nested cached function that reads dynamic root parameters via 'next/root-params' and returns an object containing pending promises, React Flight can resolve and deliver the ready portion of the payload before the inner cache finishes publishing its root parameter dependencies. Consequently, the outer cache entry finalizes and persists under a cache key that omits the root parameter dependencies, causing the first written cache entry to be served across requests with different root parameter values and bypassing nested cache invalidation rules.

Amit Schendel
Amit Schendel
0 views•10 min read
•about 2 hours ago•CVE-2026-86046
7.1

CVE-2026-86046: Arbitrary File Write via Path Traversal in termux-sync Restore Workflow

A path traversal vulnerability (CWE-22) in termux-sync prior to version 1.2.4 allows an attacker to overwrite arbitrary files within the Termux environment during the backup restoration process. The flaw stems from the application trusting attacker-controlled extraction paths defined in the backup's manifest.json file, failing to validate archive members against directory traversal sequences during tar extraction, and using unsanitized backup names when constructing temporary directories. If a user restores a malicious backup archive from local storage, shared folders, GitHub, or Google Drive, an attacker can overwrite sensitive configuration files such as shell startup scripts or local binaries, resulting in arbitrary code execution under the privileges of the Termux user.

Amit Schendel
Amit Schendel
2 views•11 min read
•about 3 hours ago•CVE-2026-129296
6.5

CVE-2026-129296: Path Traversal in SpamScope mail-parser Attachment Extraction

SpamScope mail-parser versions 3.8.0 prior to 4.6.0 contain a path traversal vulnerability (CWE-22) within the write_attachments() and write_sample() functions. The library passes untrusted attachment filenames directly into os.path.join() without stripping directory components, validating path containment, or verifying symbolic links. An attacker can send a crafted email containing relative path traversal sequences or absolute filesystem paths in the Content-Disposition header to write or overwrite arbitrary files accessible to the parsing process.

Amit Schendel
Amit Schendel
2 views•9 min read
•about 4 hours ago•CVE-2026-129295
7.5

CVE-2026-129295: Polynomial Regular Expression Denial of Service (ReDoS) in SpamScope mail-parser

A Regular Expression Denial of Service (ReDoS) vulnerability exists in SpamScope mail-parser versions 4.2.0 prior to 4.6.1. Two separate regular expressions evaluated during standard email header parsing exhibit quadratic to cubic backtracking complexity when processing headers padded with whitespace or angle brackets. An unauthenticated remote attacker can exploit this flaw by sending a small, RFC-compliant email message, causing parsing worker threads or processes to stall at 100% CPU utilization for extended periods.

Amit Schendel
Amit Schendel
2 views•10 min read
•about 5 hours ago•CVE-2026-129297
7.5

CVE-2026-129297: Sender IP Address Spoofing in SpamScope mail-parser

CVE-2026-129297 is an origin validation vulnerability (CWE-345) in the Python library mail-parser prior to version 4.6.2. The MailParser.get_server_ipaddress() method fails to properly isolate MTA-recorded client IP addresses from sender-controlled text within email Received headers. Due to naive substring delimiter matching, appearance-based regular expression scanning, and fail-open header traversal, remote attackers can spoof their originating IP address to bypass email security controls, blocklists, and anti-spam attribution.

Amit Schendel
Amit Schendel
2 views•11 min read
•about 6 hours ago•CVE-2026-129299
6.5

CVE-2026-129299: Uncaught Exceptions and Silent Header Loss via Reflective Attribute Dispatch in SpamScope mail-parser

CVE-2026-129299 (GHSA-24mq-4vc6-2prf) is a parsing and serialization flaw in SpamScope mail-parser prior to version 4.6.2. The library uses reflective Python attribute resolution (getattr) over untrusted email header names and applies caller convenience transformations (such as underscore-to-hyphen folding and _json/_raw suffix stripping) directly to wire headers. An unauthenticated remote attacker can send crafted emails that trigger uncaught TypeError exceptions during JSON serialization or cause security-relevant headers and body content to be silently dropped without setting defect indicators.

Amit Schendel
Amit Schendel
3 views•11 min read