CVE-2026-73222 — Vulnerability in claude-code-templates — CVE Details
Claude Code Templates: Unauthenticated OS command injection (RCE) in Claude Code Studio server (--studio)
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.32%). Schedule for your next planned update.
Does your project use an affected claude-code-templates version?
Paste your package-lock.json to check it for CVE-2026-73222 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
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 on0.0.0.0/::(reachable from the LAN, not just localhost).- The CORS middleware sends
Access-Control-Allow-Origin: *and answers the preflightOPTIONSfor any origin, so a browser will deliver cross-origin POSTs to it. - There is no authentication on any endpoint.
The vulnerable sinks:
POST /api/execute— thepromptbody field flows intoexecuteLocalTask():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.- POST /api/install-agent — the agentName body field: const child = spawn('npx', ['claude-code-templates@latest', '--agent', agentName, '--yes'], { /* ... */ shell: true });
- 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.
Advisory Timeline
- First published September 3, 2026 (84 days ago).
- Last revised September 3, 2026 — 0 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
npm install claude-code-templates@1.29.4
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: npm (1).
| Package | Fixed In |
|---|---|
| claude-code-templates npm · Affected: All versions | 1.29.4 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 8.8 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
References
- https://github.com/davila7/claude-code-templates/security/advisories/GHSA-79wm-x847-7cvgWEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-73222ADVISORY
- https://github.com/davila7/claude-code-templates/commit/bc4618b07232633c1c0aac12a43e436268d31783WEB
- https://github.com/davila7/claude-code-templatesPACKAGE
- https://github.com/davila7/claude-code-templates/blob/main/CHANGELOG.mdWEB
Frequently Asked Questions
- What is CVE-2026-73222?
- Claude Code Templates: Unauthenticated OS command injection (RCE) in Claude Code Studio server (--studio). This vulnerability has been assigned a severity rating of HIGH (CVSS score: 8.8/10).
- How do I check if my project is affected by CVE-2026-73222?
- CVE-2026-73222 affects claude-code-templates. It has a 0.3% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-73222 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This is a below-median EPSS score — only 17.3% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2026-83816HIGH
CodeWhale: exec_shell parallel-readonly classifier auto-approves fd/rg/git grep exec flags enabling silent RCE
- CVE-2026-83817HIGH
CodeWhale: Automation auto_approve defaults to true, bypassing the task-path hardening fix for silent recurring agent execution