CVE-2026-73222

CVE-2026-73222 is a high-severity OS command injection vulnerability in claude-code-templates (npm), affecting versions <= 1.29.2. It is fixed in 1.29.4.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

Claude Code Templates: Unauthenticated OS command injection (RCE) in Claude Code Studio server (--studio)

npx claude-code-templates --studio launches "Claude Code Studio", an Express HTTP server (cli-tool/src/sandbox-server.js, default port 3444) that binds to all interfaces (0.0.0.0), sets Access-Control-Allow-Origin: *, and requires no authentication. Two POST endpoints pass attacker-controlled request-body fields into child_process.spawn(..., { shell: true }). Because shell: true makes Node join the argv array into a single sh -c string, the fields are parsed by the shell and metacharacters execute. Any unauthenticated attacker who can reach the port, a malicious web page the developer visits, or anyone on the same LAN, can execute arbitrary OS commands on the developer's machine.

Details

In cli-tool/src/sandbox-server.js:

  • app.listen(PORT, ...) is called with no host argument, so the server listens on 0.0.0.0 / :: (reachable from the LAN, not just localhost).
  • The CORS middleware sends Access-Control-Allow-Origin: * and answers the preflight OPTIONS for any origin, so a browser will deliver cross-origin POSTs to it.
  • There is no authentication on any endpoint.

The vulnerable sinks:

  1. POST /api/execute, the prompt body field flows into executeLocalTask():

    const child = spawn('claude', [finalPrompt], { /* ... */ shell: true });
    The only validation on prompt is a length check (>= 10 chars). With shell: true, finalPrompt is interpreted by the shell.
    
  2. POST /api/install-agent, the agentName body field:
    const child = spawn('npx', ['claude-code-templates@latest', '--agent', agentName, '--yes'], { /* ... */ shell: true });

  3. agentName is used unvalidated. (The same unsafe pattern is also reachable through /api/execute's agent field via checkAndInstallAgent().)

Root cause: spawn(cmd, argsArray, { shell: true }) does not keep argsArray as separate argv entries, Node builds cmd + ' ' + argsArray.join(' ') and runs it via sh -c, so every element is subject to shell parsing.

PoC

Victim

npx claude-code-templates --studio # server on 0.0.0.0:3444

Attacker (another LAN host, or a malicious web page fetch(), or locally)

curl -s -X POST http://127.0.0.1:3444/api/execute
-H 'Content-Type: application/json'
--data '{"prompt":"aaaaaaaaaa; touch /tmp/CCT_RCE_PROOF","mode":"local"}'

curl -s -X POST http://127.0.0.1:3444/api/install-agent
-H 'Content-Type: application/json'
--data '{"agentName":"x; touch /tmp/CCT_AGENT_PROOF #"}'

ls -la /tmp/CCT_RCE_PROOF /tmp/CCT_AGENT_PROOF # both created => injected commands ran
The aaaaaaaaaa padding satisfies the 10-char minimum, then ; (or $(...), or backticks) starts the injected command. claude/npx do not even need to be installed, the injected segment runs regardless.

Confirmed at runtime on v1.28.13 (Node 22, Linux): both marker files were created, the server listened on *:3444, and an OPTIONS preflight from Origin: https://evil.example returned 200 with Access-Control-Allow-Origin: *.

Impact

Unauthenticated remote code execution (CWE-78) on any machine running --studio. Two reachability paths:

  • Drive-by: a developer running --studio who visits an attacker-controlled web page, the page's cross-origin fetch() (Content-Type application/json) passes the wildcard CORS preflight and delivers the POST, achieving RCE with no other interaction.
  • LAN: because the server binds 0.0.0.0, anyone on the same network (office, co-working space, public Wi-Fi) can hit port 3444 directly.

Impact is full compromise of the developer's user account (arbitrary command execution with the developer's privileges): source code, SSH keys, cloud credentials, and .env secrets.

Suggested fix

  • Remove shell: true from all three spawns so arguments stay discrete argv entries (kills the injection).
  • Validate agentName against a strict allowlist (^[A-Za-z0-9._/-]+$).
  • Bind to loopback only (app.listen(PORT, '127.0.0.1', ...)).
  • Replace the wildcard CORS with a same-origin allowlist and reject other origins.

Impact

Untrusted input reaches a shell command, allowing arbitrary commands to run on the host. Typical impact: code execution in the application's environment.

CVE-2026-73222 has a CVSS score of 8.8 (High). The vector is network-reachable, no privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (1.29.4); upgrading removes the vulnerable code path.

Affected versions

claude-code-templates (<= 1.29.2)

Security releases

claude-code-templates → 1.29.4 (npm)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

Upgrade claude-code-templates to 1.29.4 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is CVE-2026-73222? CVE-2026-73222 is a high-severity OS command injection vulnerability in claude-code-templates (npm), affecting versions <= 1.29.2. It is fixed in 1.29.4. Untrusted input reaches a shell command, allowing arbitrary commands to run on the host.
  2. How severe is CVE-2026-73222? CVE-2026-73222 has a CVSS score of 8.8 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of claude-code-templates are affected by CVE-2026-73222? claude-code-templates (npm) versions <= 1.29.2 is affected.
  4. Is there a fix for CVE-2026-73222? Yes. CVE-2026-73222 is fixed in 1.29.4. Upgrade to this version or later.
  5. Is CVE-2026-73222 exploitable, and should I be worried? Whether CVE-2026-73222 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2026-73222 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2026-73222? Upgrade claude-code-templates to 1.29.4 or later.

Stop the waste.
Protect your environment with Kodem.