{"id":"CVE-2026-31862","aliases":["CVE-2026-31862","GHSA-f2fc-vc88-6w7q"],"related":[],"kind":"vulnerability","state":"published","title":"Cloud CLI has Command Injection via Multiple Parameters","summary":"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, 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. This vulnerability is fixed in 1.24.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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, 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. This vulnerability is fixed in 1.24.0.","source":"cvelist"},{"lang":"en","text":"### Summary\nMultiple 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.\n\n### Details\nThe 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().\n\nThe application attempts to escape double quotes in some parameters, but this protection is trivially bypassable using other shell metacharacters such as:\n\nCommand substitution: $(command) or \\`command\\`\nCommand chaining: ;, &&, ||\nNewlines and other control characters\n\n### Affected Endpoints\n`GET /api/git/diff - file parameter`\n`GET /api/git/status - file parameter`\n`POST /api/git/commit - files array and message parameter`\n`POST /api/git/checkout - branch parameter`\n`POST /api/git/create-branch - branch parameter`\n`GET /api/git/commits - commit hash parameter`\n`GET /api/git/commit-diff - commit parameter`\n\n### Vulnerable Code\n\nFile: server/routes/git.js\n```\n// Line 205 - git status with file parameter\nconst { stdout: statusOutput } = await execAsync(\n  `git status --porcelain \"${file}\"`,  // INJECTION via file\n  { cwd: projectPath }\n);\n```\n```\n// Lines 375-379 - git commit with files array and message\nfor (const file of files) {\n  await execAsync(`git add \"${file}\"`, { cwd: projectPath });  // INJECTION via files[]\n}\nconst { stdout } = await execAsync(\n  `git commit -m \"${message.replace(/\"/g, '\\\\\"')}\"`,  // INJECTION via message (bypass with $())\n  { cwd: projectPath }\n);\n```\n```\n// Lines 541-543 - git show with commit parameter (no quotes!)\nconst { stdout } = await execAsync(\n  `git show ${commit}`,  // INJECTION via commit\n  { cwd: projectPath }\n);\n```\n\n### Impact\n- Remote Code Execution as the Node.js process user\n- Full server compromise\n- Data exfiltration\n- Supply chain attacks - modify committed code to inject malware\n\n---\n\n### Fix\n\n**Commit:** siteboon/claudecodeui@55567f4\n\n#### Root cause remediation\n\nAll 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.\n\n**Endpoints patched in `server/routes/git.js`:**\n\n- `GET /api/git/diff` — `file` (4 calls)\n- `GET /api/git/file-with-diff` — `file` (3 calls)\n- `POST /api/git/commit` — `files[]`, `message`\n- `POST /api/git/checkout` — `branch`\n- `POST /api/git/create-branch` — `branch`\n- `GET /api/git/commits` — `commit.hash`\n- `GET /api/git/commit-diff` — `commit`\n- `POST /api/git/generate-commit-message` — `file`\n- `POST /api/git/discard` — `file` (3 calls)\n- `POST /api/git/delete-untracked` — `file`\n- `POST /api/git/publish` — `branch`\n\nA 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.\n\n#### Before / After\n\n```js\n// BEFORE — shell interprets the string, injection possible\nconst { stdout } = await execAsync(`git show ${commit}`, { cwd: projectPath });\n\n// AFTER — no shell, args passed directly to the process\nconst { stdout } = await spawnAsync('git', ['show', commit], { cwd: projectPath });\n```","format":"markdown","source":"ghsa"},{"lang":"es","text":"Cloud CLI (también conocida como Claude Code UI) es una interfaz de usuario (UI) de escritorio y móvil para Claude Code, Cursor CLI, Codex y Gemini-CLI. Antes de la versión 1.24.0, múltiples puntos finales de API relacionados con Git utilizan execAsync() con interpolación de cadenas de parámetros controlados por el usuario (file, branch, message, commit), lo que permite a atacantes autenticados ejecutar comandos arbitrarios del sistema operativo. Esta vulnerabilidad está corregida en la versión 1.24.0.","source":"nvd"}],"published":"2026-03-11T00:25:43.000Z","modified":"2026-11-05T18:00:04.058Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","score":9.1,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","score":9.1,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","score":9.1,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"}],"cwes":["CWE-77","CWE-78"],"affected":[{"ranges":[{"version":"< 1.24.0","status":"affected"}],"vendor":"siteboon","product":"claudecodeui","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.24.0"}],"ecosystem":"npm","package":"@siteboon/claude-code-ui","purl":"pkg:npm/%40siteboon/claude-code-ui","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.24.0"}],"vendor":"cloudcli","product":"cloud_cli","cpe":"cpe:2.3:a:cloudcli:cloud_cli:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/siteboon/claudecodeui/security/advisories/GHSA-f2fc-vc88-6w7q","tags":["vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/siteboon/claudecodeui/releases/tag/v1.24.0","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31862","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/siteboon/claudecodeui","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-03-12T14:21:55.099Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-31862","url":"https://www.cve.org/CVERecord?id=CVE-2026-31862","licence":"CVE Terms of Use","modified":"2026-03-12T14:22:04.149Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-f2fc-vc88-6w7q","url":"https://github.com/advisories/GHSA-f2fc-vc88-6w7q","licence":"CC-BY-4.0","modified":"2026-11-05T18:00:04.058Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-31862","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31862","licence":"Public domain","modified":"2026-06-17T10:34:39.217Z"}],"updatedAt":"2026-11-25T22:59:15.759Z","epss":{"score":0.00497,"percentile":0.44195,"date":"2026-12-01T12:00:22.000Z"}}