{"id":"CVE-2026-31862","kind":"vulnerability","aliases":["CVE-2026-31862","GHSA-f2fc-vc88-6w7q"],"related":[],"title":"@siteboon/claude-code-ui is Vulnerable to Command Injection via Multiple Parameters","description":"### 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```","summary":"The @siteboon/claude-code-ui web app passes user-supplied Git parameters (file, branch, commit message, commit hash) into shell command strings, so an authenticated user can chain shell commands. An attacker can run arbitrary OS commands as the Node.js process user, which means full server compromise.","severity":"critical","cvss":9.1,"epss":0.00454,"exploited":false,"exploited_at":null,"products":[{"name":"@siteboon/claude-code-ui","fixed":["1.24.0"],"affected":"<= 1.23.0","ecosystem":"npm"},{"name":"cloudcli cloud cli","fixed":["1.24.0"],"affected":"< 1.24.0","ecosystem":"vendor"}],"ecosystems":["npm","vendor"],"tags":["ai-tooling","claude-code","cwe-77","cwe-78","git","node","self-hosted"],"not_affected_if":["no-user-accounts-exposed","version-1.24.0-or-later"],"how_to_check":"- Check the installed version with `npm ls @siteboon/claude-code-ui` and confirm it is above `1.23.0`.\n- Confirm whether the app's server exposes `/api/git/*` endpoints to users who can log in.\n- Search `server/routes/git.js` for `execAsync(` calls that interpolate request parameters.","fix":"- `@siteboon/claude-code-ui`: move to `1.24.0` or later.","status":"open","published_at":"2026-03-11T00:25:43+00:00","first_seen_at":"2026-11-05T17:59:32+00:00","triaged_at":"2026-11-05T18:00:40+00:00","updated_at":"2026-11-05T18:09:59+00:00","category":"ai-tooling","confidence":0.9,"triage":{"at":"2026-11-05T18:00:40Z","model":"claude-haiku-5-5","output":{"fix":"- `@siteboon/claude-code-ui`: move to `1.24.0` or later.","reach":"network","title":"Claude Code UI: Git API parameters allow OS command injection by authenticated users","impact":"high","summary":"The @siteboon/claude-code-ui web app passes user-supplied Git parameters (file, branch, commit message, commit hash) into shell command strings, so an authenticated user can chain shell commands. An attacker can run arbitrary OS commands as the Node.js process user, which means full server compromise.","audience":"developers","category":"ai-tooling","nicknames":[],"who_cares":["claude-code","node","git","self-hosted"],"confidence":0.9,"fix_status":"available","needs_auth":"yes","worst_case":"Authenticated user runs arbitrary OS commands on the server as Node process user","analyst_note":"","how_to_check":"- Check the installed version with `npm ls @siteboon/claude-code-ui` and confirm it is above `1.23.0`.\n- Confirm whether the app's server exposes `/api/git/*` endpoints to users who can log in.\n- Search `server/routes/git.js` for `execAsync(` calls that interpolate request parameters.","plain_action":"","needs_analyst":false,"not_affected_if":["version-1.24.0-or-later","no-user-accounts-exposed"],"who_is_affected":"Any team running @siteboon/claude-code-ui at version 1.23.0 or earlier is exposed, since the Git endpoints pass request parameters straight into a shell. Exposure requires an account on the app, so instances open only to trusted users are at lower risk but still should be upgraded. Installs at 1.24.0 or later are not affected.","user_interaction":"no","needs_special_setup":"no","severity_if_unknown":"critical"},"cost_usd":0.000871,"input_tokens":5597,"output_tokens":622,"severity_before":"critical"},"analyst_status":null,"analyst_note":null,"search":"'-2026':11A,19A '-31862':12A,20A '-379':249C '-543':290C '-77':32B '-78':34B '-9':424C '/api/git/checkout':206C,394C '/api/git/commit':199C,390C '/api/git/commit-diff':219C,403C,440C '/api/git/commits':214C,400C '/api/git/create-branch':210C,397C '/api/git/delete-untracked':414C '/api/git/diff':191C,380C '/api/git/discard':409C '/api/git/file-with-diff':385C '/api/git/generate-commit-message':406C '/api/git/publish':417C '/api/git/status':195C '/g':280C '/i':430C '0':423C '205':227C '3':387C,411C '375':248C '4':382C,428C '541':289C '55567f4':336C '64':429C '6w7q':17A 'a-f':425C 'accept':127C 'add':265C,433C 'affect':188C 'ai':26B 'ai-tool':25B 'allow':106C 'allowlist':421C 'also':432C 'api':90C,123C 'app':43B 'applic':117C,155C 'arbitrari':72B,111C 'arg':469C 'argument':358C 'array':201C,254C,363C 'attack':69B,108C,326C 'attempt':156C 'authent':62B,107C 'await':236C,262C,274C,300C,459C,477C 'branch':51B,103C,136C,207C,211C,395C,398C,418C 'bypass':169C,284C 'call':343C,383C,388C,412C 'caus':338C 'chain':65B,182C,325C 'charact':187C 'child_process.spawn':354C 'claud':29B 'claude-cod':28B 'claudecodeui':116C 'cli':24A 'cloud':23A 'cloudcli':22A 'code':30B,223C,312C,329C 'command':5A,58B,67B,74B,113C,149C,176C,178C,180C,181C 'commit':52B,54B,105C,138C,141C,215C,220C,251C,277C,294C,304C,307C,328C,334C,404C,437C,463C,481C 'commit.hash':401C 'compromis':84B,321C 'const':233C,258C,272C,298C,457C,475C 'control':100C,130C,186C 'cve':10A,18A 'cwd':245C,267C,286C,308C,464C,482C 'cwe':31B,33B 'data':322C 'detail':114C 'direct':145C,364C,471C 'doubl':159C 'endpoint':91C,124C,126C,189C,375C 'escap':158C 'execasync':93C,153C,237C,263C,275C,301C,342C,460C 'execut':110C,313C 'exfiltr':323C 'exist':349C 'f':427C 'f2fc':15A 'fals':357C 'file':50B,102C,134C,192C,196C,200C,224C,231C,241C,244C,253C,259C,261C,266C,271C,381C,386C,391C,407C,410C,415C 'fix':333C 'full':82B,319C 'get':190C,194C,213C,218C,379C,384C,399C,402C 'ghsa':14A 'ghsa-f2fc-vc88-6w7q':13A 'git':35B,48B,88C,119C,228C,238C,250C,264C,276C,291C,302C,445C,461C,479C 'git-rel':87C 'hash':55B,142C,216C 'helper':351C 'host':39B 'impact':310C 'inert':374C 'inject':6A,242C,269C,281C,305C,331C,455C 'input':372C 'integr':120C 'interpol':96C,146C 'interpret':452C 'js':449C 'line':226C,247C,288C 'm':278C 'malwar':332C 'mean':81B 'messag':53B,104C,139C,203C,256C,283C,392C 'message.replace':279C 'metacharact':173C,369C 'modifi':327C 'multipl':8A,86C 'name':137C 'newlin':183C 'node':36B 'node.js':77B,316C 'os':73B,112C,367C 'paramet':9A,49B,101C,131C,163C,193C,197C,204C,208C,212C,217C,221C,232C,295C,438C 'pass':44B,151C,360C,470C 'patch':376C 'path':135C 'porcelain':240C 'possibl':456C 'post':198C,205C,209C,389C,393C,396C,405C,408C,413C,416C 'process':78B,317C,446C,474C 'projectpath':246C,268C,287C,309C,465C,483C 'protect':166C 'provid':118C 'quot':160C,297C 'reach':443C 'regex':422C 'relat':89C 'remedi':339C 'remot':311C 'replac':346C 'root':337C 'run':71B 'self':38B 'self-host':37B 'server':83B,320C 'server/routes/git.js':225C,378C 'shell':57B,66B,148C,172C,356C,368C,451C,468C 'show':292C,303C,462C,480C 'siteboon/claude-code-ui':1A,21A,41B 'siteboon/claudecodeui':335C 'spawnasync':350C,478C 'status':229C,239C 'statusoutput':235C 'stdout':234C,273C,299C,458C,476C 'strict':420C 'string':59B,95C,150C,454C 'substitut':177C 'summari':85C 'suppli':47B,324C 'tool':27B 'trivial':168C 'use':92C,170C,353C 'user':46B,63B,79B,99C,129C,318C,371C 'user-control':98C,128C 'user-suppli':45B 'valid':435C 'various':122C 'vc88':16A 'via':7A,243C,270C,282C,306C 'vulner':3A,222C,341C 'web':42B","nicknames":[],"mitigations":[],"who_affected":"Any team running @siteboon/claude-code-ui at version 1.23.0 or earlier is exposed, since the Git endpoints pass request parameters straight into a shell. Exposure requires an account on the app, so instances open only to trusted users are at lower risk but still should be upgraded. Installs at 1.24.0 or later are not affected.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"developers","plain_action":null,"pkeys":["claudecodeui","cloudcli","cloudclicloudcli"],"ptokens":["claude","cli","cloud","cloudcli","code","siteboon","ui"],"labels":["aitooling","claudecode","critical","cwe77","cwe78","git","node","npm","selfhosted","vendor"],"campaign_type":null,"first_public_at":"2026-03-09T21:40:12+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","cvss_by":"GitHub","poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-f2fc-vc88-6w7q","url":"https://github.com/advisories/GHSA-f2fc-vc88-6w7q","severity":"critical","published_at":"2026-03-11T00:25:43+00:00","modified_at":"2026-11-05T17:56:40+00:00","first_seen_at":"2026-11-05T17:59:32+00:00","fetched_at":"2026-11-05T18:06:36+00:00","note":null},{"source":"nvd","external_id":"CVE-2026-31862","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31862","severity":null,"published_at":"2026-03-11T18:16:25+00:00","modified_at":"2026-06-17T10:34:39+00:00","first_seen_at":"2026-11-05T18:09:59+00:00","fetched_at":"2026-11-05T18:09:59+00:00","note":null}],"documents":[{"id":78433,"url":"https://api.github.com/repos/siteboon/claudecodeui/security-advisories/GHSA-f2fc-vc88-6w7q","title":"Maintainer's advisory: api.github.com","kind":"vendor","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Maintainer's advisory: api.github.com"},{"id":78434,"url":"https://github.com/siteboon/claudecodeui/security/advisories/GHSA-f2fc-vc88-6w7q","title":"Maintainer's advisory: github.com","kind":"vendor","source":"ghsa","publisher":"vendor","text":null,"published_at":"2026-03-09T21:40:12+00:00","relation":"advisory","confidence":null,"note":"Maintainer's advisory: github.com"},{"id":78435,"url":"https://github.com/siteboon/claudecodeui/releases/tag/v1.24.0","title":"Release: github.com","kind":"release","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Release: github.com"}],"exploit_sources":[{"type":"epss","score":0.00454,"url":"https://api.first.org/data/v1/epss?cve=CVE-2026-31862"}],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}