CVE-2026-31861: @siteboon/claude code ui @siteboon/claude-code-ui Is Vulnerable To Shell Vulnerability

HIGH
Advisory Identifier: GHSA-7fv4-fmmc-86g2
CWE-94
Published
Advisory Summary

CVE-2026-31861 is a HIGH @siteboon/claude-code-ui is vulnerable to shell vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting @siteboon/claude code ui libraries in the npm ecosystem. The issue involves @siteboon/claude-code-ui is vulnerable to shell command injection in git routes. Remediation is available by upgrading affected packages to version 1.24.0.

CVE-2026-31861 at a Glance

CVE Identifier CVE-2026-31861
GHSA Identifier GHSA-7fv4-fmmc-86g2
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product @siteboon/claude code ui
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-31861

To remediate this vulnerability, upgrade all affected @siteboon/claude code ui dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@siteboon/claude-code-ui fixed: 1.24.0
npm install @siteboon/claude-code-ui@1.24.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @siteboon/claude-code-ui

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-31861, inspect your project dependencies using npm:

npm ls @siteboon/claude-code-ui

Analyze the terminal output to locate any version of @siteboon/claude code ui in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.24.0), your application is affected.

Note: The npm ls @siteboon/claude-code-ui command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In @siteboon/claude code ui, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

# Shell Command Injection in User Git Config Endpoint | Field | Value | |-------|-------| | **Severity** | High | | **CVSS 3.1** | 8.8 (High) — when chained with VULN-01 | | **CWE** | CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | | **Attack Vector** | Network | | **Authentication** | JWT required (bypassable via VULN-01) | | **Affected Files** | `server/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: ```javascript 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 ```bash # 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): ```javascript // 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]); ```

CVE-2026-31861 Affected @siteboon/claude code ui Versions

1 component(s)
Fixed Versions:
1.24.0
Product / Package Ecosystem Affected Versions Fixed Version
@siteboon/claude-code-ui
npm
< 1.24.0
1.24.0

References

Frequently Asked Questions

What is CVE-2026-31861?
CVE-2026-31861 is a security vulnerability in @siteboon/claude code ui involving @siteboon/claude-code-ui is Vulnerable to Shell Command Injection in Git Routes under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which @siteboon/claude code ui versions are affected?
Affected versions include releases prior to 1.24.0 across affected packages: @siteboon/claude-code-ui.
What version fixes CVE-2026-31861?
Upgrading to 1.24.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @siteboon/claude-code-ui affected?
Yes, @siteboon/claude-code-ui is affected in releases prior to 1.24.0. Upgrade your dependency to 1.24.0 or later.
What CWE is associated with CVE-2026-31861?
CVE-2026-31861 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check npm dependencies for CVE-2026-31861?
Run the dependency tree command: 'npm ls @siteboon/claude-code-ui'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-7fv4-fmmc-86g2",
  "modified" : "2026-03-11T20:45:18Z",
  "published" : "2026-03-10T23:57:23Z",
  "aliases" : [ "CVE-2026-31861" ],
  "summary" : "@siteboon/claude-code-ui is Vulnerable to Shell Command Injection in Git Routes",
  "details" : "# Shell Command Injection in User Git Config Endpoint\n\n| Field | Value |\n|-------|-------|\n| **Severity** | High |\n| **CVSS 3.1** | 8.8 (High) — when chained with VULN-01 |\n| **CWE** | CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') |\n| **Attack Vector** | Network |\n| **Authentication** | JWT required (bypassable via VULN-01) |\n| **Affected Files** | `server/routes/user.js` (lines 58-59) |\n\n## Description\n\nThe `/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.\n\nThis allows authenticated attackers to execute arbitrary OS commands via the git configuration endpoint.\n\n## Root Cause\n\n`server/routes/user.js` lines 58-59:\n\n```javascript\nawait execAsync(`git config --global user.name \"${gitName.replace(/\"/g, '\\\\\"')}\"`);\nawait execAsync(`git config --global user.email \"${gitEmail.replace(/\"/g, '\\\\\"')}\"`);\n```\n\nOnly `\"` is escaped. However, within double-quoted bash strings, the following are still interpreted:\n\n- `` `malicious_command` `` — backtick execution\n- `$(malicious_command)` — subshell execution\n\n## Impact\n\n- **Remote Code Execution (RCE)** — arbitrary OS commands execute as the Node.js process user\n- The `git config --global` vector modifies the **server-wide** git configuration, affecting all git operations\n- When chained with VULN-01 (hardcoded JWT), this is fully **unauthenticated RCE**\n- Attacker can: read/write any file, install backdoors, pivot to other systems, exfiltrate data\n\n## Proof of Concept\n\n```bash\n# Step 1: Forge a JWT (see VULN-01)\nTOKEN=$(python3 -c \"import jwt; print(jwt.encode({'userId':1,'username':'admin'}, 'claude-ui-dev-secret-change-in-production', algorithm='HS256'))\")\n\n# Step 2: Inject via gitName using command substitution\ncurl -X POST \"http://REDACTED:5173/api/user/git-config\" \\\n  -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"gitName\":\"$(id)\",\"gitEmail\":\"attacker@example.com\"}'\n```\n\nThe server executes:\n\n```\ngit config --global user.name \"$(id)\"\n```\n\nBash evaluates `$(id)` before passing it to git, executing the `id` command and setting the username to the output.\n\n## Remediation\n\nReplace `exec()` with `spawn()` (array arguments, no shell):\n\n```javascript\n// BEFORE (vulnerable):\nawait execAsync(`git config --global user.name \"${gitName.replace(/\"/g, '\\\\\"')}\"`);\n\n// AFTER (safe):\nawait spawnAsync('git', ['config', '--global', 'user.name', gitName]);\nawait spawnAsync('git', ['config', '--global', 'user.email', gitEmail]);\n```",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@siteboon/claude-code-ui"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.24.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.23.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/siteboon/claudecodeui/security/advisories/GHSA-7fv4-fmmc-86g2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-31861"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/siteboon/claudecodeui/commit/86c33c1c0cb34176725a38f46960213714fc3e04"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/siteboon/claudecodeui"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/siteboon/claudecodeui/releases/tag/v1.24.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-10T23:57:23Z",
    "nvd_published_at" : "2026-03-11T18:16:24Z"
  }
}