Open-Source Security Intelligence

Know every vulnerability
before it knows you.

DevGuard continuously monitors your dependencies and alerts you when CVEs like this one affect your stack — with real-time threat intelligence built for developers.

Search

GHSA-f2fc-vc88-6w7q

CriticalCVSS 9.1 / 10
Published Mar 11, 2026·Last modified Mar 13, 2026
Affected Components(0)

No affected components available

Description

Summary

Multiple Git-related API endpoints use execAsync() with string interpolation of user-controlled parameters (file, branch, message, commit), allowing authenticated attackers to execute arbitrary OS commands.

Details

The claudecodeui application provides Git integration through various API endpoints. These endpoints accept user-controlled parameters such as file paths, branch names, commit messages, and commit hashes, which are directly interpolated into shell command strings passed to execAsync().

The application attempts to escape double quotes in some parameters, but this protection is trivially bypassable using other shell metacharacters such as:

Command substitution: $(command) or `command` Command chaining: ;, &&, || Newlines and other control characters

Affected Endpoints

GET /api/git/diff - file parameter GET /api/git/status - file parameter POST /api/git/commit - files array and message parameter POST /api/git/checkout - branch parameter POST /api/git/create-branch - branch parameter GET /api/git/commits - commit hash parameter GET /api/git/commit-diff - commit parameter

Vulnerable Code

File: server/routes/git.js

// Line 205 - git status with file parameter
const { stdout: statusOutput } = await execAsync(
  `git status --porcelain "${file}"`,  // INJECTION via file
  { cwd: projectPath }
);
// Lines 375-379 - git commit with files array and message
for (const file of files) {
  await execAsync(`git add "${file}"`, { cwd: projectPath });  // INJECTION via files[]
}
const { stdout } = await execAsync(
  `git commit -m "${message.replace(/"/g, '\\"')}"`,  // INJECTION via message (bypass with $())
  { cwd: projectPath }
);
// Lines 541-543 - git show with commit parameter (no quotes!)
const { stdout } = await execAsync(
  `git show ${commit}`,  // INJECTION via commit
  { cwd: projectPath }
);

Impact

  • Remote Code Execution as the Node.js process user
  • Full server compromise
  • Data exfiltration
  • Supply chain attacks - modify committed code to inject malware

Fix

Commit: siteboon/claudecodeui@55567f4

Root cause remediation

All vulnerable execAsync() calls have been replaced with the existing spawnAsync() helper (which uses child_process.spawn with shell: false). Arguments are passed as an array directly to the OS — shell metacharacters in user input are inert.

Endpoints patched in server/routes/git.js:

  • GET /api/git/difffile (4 calls)
  • GET /api/git/file-with-difffile (3 calls)
  • POST /api/git/commitfiles[], message
  • POST /api/git/checkoutbranch
  • POST /api/git/create-branchbranch
  • GET /api/git/commitscommit.hash
  • GET /api/git/commit-diffcommit
  • POST /api/git/generate-commit-messagefile
  • POST /api/git/discardfile (3 calls)
  • POST /api/git/delete-untrackedfile
  • POST /api/git/publishbranch

A strict allowlist regex (/^[0-9a-f]{4,64}$/i) was also added to validate the commit parameter in /api/git/commit-diff before it reaches the git process.

Before / After

// BEFORE — shell interprets the string, injection possible
const { stdout } = await execAsync(`git show ${commit}`, { cwd: projectPath });

// AFTER — no shell, args passed directly to the process
const { stdout } = await spawnAsync('git', ['show', commit], { cwd: projectPath });
Risk Scores
Base Score
9.1

The vulnerability can be exploited over the network without needing physical access. It is easy for an attacker to exploit this vulnerability. An attacker needs high-level or administrative privileges. No user interaction is needed for the attacker to exploit this vulnerability. The vulnerability can affect other systems as well, not just the initial system. There is a high impact on the confidentiality of the information. There is a high impact on the integrity of the data. There is a high impact on the availability of the system.

Threat Intelligence
8.3

Exploitation activity has been observed. Apply available patches or mitigations urgently.

EPSS
0.44%

The exploit probability is very low. The vulnerability is unlikely to be exploited in the next 30 days.

Exploit
Not available

We did not find any exploit available. Neither in GitHub repositories nor in the Exploit-Database.

Scan your project

Continuously monitor your dependencies and get alerted when vulnerabilities like this one affect your stack.

Checkout DevGuard