/

CVE-2026-31861

Severity:

HIGH RISK

(8.8)

OS Command Injection in Cloud CLI git-config Endpoint

CVE-2026-31861

Analyzed

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-94

Impact:

Authenticated Remote Code Execution

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

An OS command injection vulnerability in Cloud CLI's git configuration endpoint allows user-controlled gitName and gitEmail values to be interpolated into shell commands executed via child_process.exec().

Because special shell syntax remains interpretable inside double quotes, an authenticated attacker can craft input that triggers arbitrary operating system command execution on the host running Cloud CLI.

Affected context

This issue affects Cloud CLI (Claude Code UI) desktop and mobile deployments where the /api/user/git-config API is exposed to authenticated users and implemented using shell commands constructed from user-supplied values.

The vulnerability is present when:

  • The server uses child_process.exec() or equivalent to run git configuration commands
  • gitName and gitEmail parameters are concatenated into shell command strings
  • Only double quotes (") are escaped, leaving backticks, $() substitution, and backslash escapes intact within double-quoted bash strings.

Exploit preconditions

  • Attack surface: HTTP(S) API endpoint /api/user/git-config
  • Required access: Valid authenticated user session in Cloud CLI; no special OS-level privileges required beyond the service process
  • Trigger point: Submission of crafted gitName or gitEmail parameters that are interpolated into a shell command executed by child_process.exec()
  • Why exploitation is possible: The application performs string interpolation into a shell command and relies on insufficient escaping inside double quotes, allowing bash to interpret backticks, command substitution, and escape sequences as executable syntax.

Why this happens

The root cause is the construction of shell commands using untrusted input and passing them to a shell interpreter via child_process.exec().

This is a form of OS command injection corresponding to CWE-94: Improper Control of Generation of Code (Code Injection), where attacker-controlled data becomes part of executable code—in this case, shell command code.

Relying on ad-hoc escaping within double-quoted strings is inherently fragile, because bash still interprets features such as backticks, $() command substitution, and escape sequences, enabling attackers to smuggle additional commands into the execution context.

Potential impact

  • Execution of arbitrary OS commands with the privileges of the Cloud CLI process
  • Reading, modifying, or deleting files accessible to the application user account
  • Theft of source code, credentials, or other sensitive data from the host environment
  • Lateral movement within the developer's workstation or CI environment
  • Installation of backdoors, malware, or persistence mechanisms on the affected system

General mitigation guidance

Effective mitigation centers on eliminating shell command construction from untrusted input and reducing the trust placed in user-provided values:

  • Use parameterized, library-level APIs instead of shelling out (e.g., git libraries or child_process.spawn/execFile with argument arrays and no shell)
  • Avoid passing user input through a shell interpreter; if a shell is truly unavoidable, strictly whitelist allowable characters and patterns rather than attempt escaping
  • Separate data from control by treating gitName and gitEmail as pure data arguments, not fragments of command strings
  • Run the service under a least-privilege account with minimal filesystem and network permissions to limit blast radius
  • Apply generic hardening on hosts running Cloud CLI, such as process-level sandboxing where feasible

How teams detect issues like this

Detection typically involves a mix of code-level analysis and operational monitoring:

  • Static analysis rules to flag uses of child_process.exec(), system(), or similar APIs where untrusted input flows into command strings
  • Code review checklists that explicitly call out shell command construction and require justification or safer alternatives
  • Pattern-based scanning for string concatenation or template literals that combine user input with shell metacharacters (e.g., backticks, $(), pipes, semicolons)
  • Runtime monitoring and logging for unusual git configuration requests or commands executed by the Cloud CLI process, potentially correlated with user activity
  • Integration of automated security review tools in CI pipelines to detect command injection patterns before release

Sources

SourceLink
github.comgithub.com/siteboon/claudecodeui/commit/86c33c1c0cb34176725a38f46960213714fc3e04
github.comgithub.com/siteboon/claudecodeui/releases/tag/v1.24.0
github.comgithub.com/siteboon/claudecodeui/security/advisories/GHSA-7fv4-fmmc-86g2

Frequently asked

questions

It is remotely exploitable in the context of Cloud CLI's API: any attacker who can authenticate to the application and reach the /api/user/git-config endpoint can attempt exploitation over the network or through the UI, without local shell access to the host.

The attacker must be an authenticated Cloud CLI user with permission to call the git configuration endpoint. No administrative privileges are required within Cloud CLI, but the impact depends on the OS permissions of the process running the application.

The most robust fix is to avoid constructing shell commands from user input entirely and instead use safe, parameterized APIs. For git operations, this means using dedicated libraries or child_process spawn/execFile with argument arrays, ensuring user input is never interpreted by a shell.

Prevention relies on design-time decisions and secure coding practices: ban or tightly restrict shell-based command execution in server code, mandate the use of parameterized APIs, enforce security-focused code reviews around any external process invocation, and incorporate static analysis rules that highlight potential command injection sinks whenever new code is introduced.

Find out what's already
exploitable in your codebase.