CVE-2026-73222: Claude Code Templates Remote Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-79wm-x847-7cvg
CVSS 8.8
CWE-78 CWE-306 CWE-352
Published
Advisory Summary

CVE-2026-73222 is a HIGH (CVSS 8.8) remote code execution vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Claude Code Templates libraries in the npm ecosystem. The issue involves unauthenticated os command injection (rce) in claude code studio server (--studio). Remediation is available by upgrading affected packages to version 1.29.4.

CVE-2026-73222 at a Glance

CVE Identifier CVE-2026-73222
GHSA Identifier GHSA-79wm-x847-7cvg
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Claude Code Templates
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-73222

To remediate this vulnerability, upgrade all affected Claude Code Templates dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

claude-code-templates fixed: 1.29.4
npm install claude-code-templates@1.29.4
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 claude-code-templates

How to Check if You Are Affected

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

npm ls claude-code-templates

Analyze the terminal output to locate any version of Claude Code Templates in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.29.4), your application is affected.

Note: The npm ls claude-code-templates 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-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Claude Code Templates, 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

### Summary `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()`: ```js 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 }); 2. 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.

CVE-2026-73222 Affected Claude Code Templates Versions

1 component(s)
Fixed Versions:
1.29.4
Product / Package Ecosystem Affected Versions Fixed Version
claude-code-templates
npm
< 1.29.4
1.29.4

References

Frequently Asked Questions

What is CVE-2026-73222?
CVE-2026-73222 is a security vulnerability in Claude Code Templates involving Unauthenticated OS command injection (RCE) in Claude Code Studio server (--studio) under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Claude Code Templates versions are affected?
Affected versions include releases prior to 1.29.4 across affected packages: claude-code-templates.
What version fixes CVE-2026-73222?
Upgrading to 1.29.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is claude-code-templates affected?
Yes, claude-code-templates is affected in releases prior to 1.29.4. Upgrade your dependency to 1.29.4 or later.
What is the CVSS score of CVE-2026-73222?
CVE-2026-73222 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-73222?
CVE-2026-73222 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check npm dependencies for CVE-2026-73222?
Run the dependency tree command: 'npm ls claude-code-templates'. 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-79wm-x847-7cvg",
  "modified" : "2026-09-03T19:50:47Z",
  "published" : "2026-09-03T19:50:47Z",
  "aliases" : [ "CVE-2026-73222" ],
  "summary" : "Claude Code Templates: Unauthenticated OS command injection (RCE) in Claude Code Studio server (--studio)",
  "details" : "### Summary\n`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.\n\n### Details\nIn `cli-tool/src/sandbox-server.js`:\n\n- `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).\n- 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.\n- There is no authentication on any endpoint.\n\nThe vulnerable sinks:\n\n1. `POST /api/execute` — the `prompt` body field flows into `executeLocalTask()`:\n   ```js\n   const child = spawn('claude', [finalPrompt], { /* ... */ shell: true });\n   The only validation on prompt is a length check (>= 10 chars). With shell: true, finalPrompt is interpreted by the shell.\n\n2. POST /api/install-agent — the agentName body field:\nconst child = spawn('npx', ['claude-code-templates@latest', '--agent', agentName, '--yes'], { /* ... */ shell: true });\n2. agentName is used unvalidated. (The same unsafe pattern is also reachable through /api/execute's agent field via checkAndInstallAgent().)\n\nRoot 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.\n\nPoC\n\n# Victim\nnpx claude-code-templates --studio          # server on 0.0.0.0:3444\n\n# Attacker (another LAN host, or a malicious web page fetch(), or locally)\ncurl -s -X POST http://127.0.0.1:3444/api/execute \\\n  -H 'Content-Type: application/json' \\\n  --data '{\"prompt\":\"aaaaaaaaaa; touch /tmp/CCT_RCE_PROOF\",\"mode\":\"local\"}'\n\ncurl -s -X POST http://127.0.0.1:3444/api/install-agent \\\n  -H 'Content-Type: application/json' \\\n  --data '{\"agentName\":\"x; touch /tmp/CCT_AGENT_PROOF #\"}'\n\nls -la /tmp/CCT_RCE_PROOF /tmp/CCT_AGENT_PROOF   # both created => injected commands ran\nThe 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.\n\nConfirmed 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: *.\n\nImpact\n\nUnauthenticated remote code execution (CWE-78) on any machine running --studio. Two reachability paths:\n- 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.\n- 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.\n\nImpact 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.\n\nSuggested fix\n\n- Remove shell: true from all three spawns so arguments stay discrete argv entries (kills the injection).\n- Validate agentName against a strict allowlist (^[A-Za-z0-9._/-]+$).\n- Bind to loopback only (app.listen(PORT, '127.0.0.1', ...)).\n- Replace the wildcard CORS with a same-origin allowlist and reject other origins.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "claude-code-templates"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.29.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.29.2"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/davila7/claude-code-templates/security/advisories/GHSA-79wm-x847-7cvg"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-73222"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/davila7/claude-code-templates/commit/bc4618b07232633c1c0aac12a43e436268d31783"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/davila7/claude-code-templates"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/davila7/claude-code-templates/blob/main/CHANGELOG.md"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-306", "CWE-352", "CWE-78" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-03T19:50:47Z",
    "nvd_published_at" : "2026-08-11T19:18:51Z"
  }
}