Skip to main content
EPSS 0.3%top 78%

CVE-2026-73222: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in davila7 claude-code-templates

0
High
Published: 09/04/2026 (09/04/2026, 08:51:25 UTC)
Source: CVE Database V5
Vendor/Project: davila7
Product: claude-code-templates

Description

### 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.

CVSS v3.1

Score 8.8high

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

Affected software

davila7

claude-code-templates

Affected versions
<1.29.4
davila7/claude-code-templates
pkg:npm/davila7/claude-code-templates
Affected versions
<1.29.4

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 08/11/2026, 19:11:57 UTC

Technical Analysis

The davila7 claude-code-templates CLI tool before version 1.29.4 contains an OS command injection vulnerability (CWE-78) due to improper neutralization of special elements in user-supplied input. The vulnerable server component binds to all network interfaces on port 3444 without authentication and permits cross-origin requests. The POST endpoints /api/execute and /api/install-agent accept attacker-controlled input fields that are passed directly to child_process.spawn() with shell execution enabled, allowing shell metacharacters to be interpreted. This enables remote attackers who can reach the port or induce developers to visit malicious sites to execute arbitrary OS commands with the privileges of the developer running the Studio server. The vulnerability is addressed in version 1.29.4.

Potential Impact

Successful exploitation allows remote attackers to execute arbitrary operating system commands with the privileges of the developer running the Studio server. This can lead to compromise of source code, credentials, and local data. The vulnerability requires either direct network access to the exposed port 3444 or social engineering to convince a developer to visit a malicious website. The CVSS 3.1 base score is 8.8 (High), reflecting network attack vector, low attack complexity, no privileges required, user interaction required, and high impact on confidentiality, integrity, and availability.

Mitigation Recommendations

This vulnerability is fixed in version 1.29.4 of claude-code-templates. Users should upgrade to version 1.29.4 or later to remediate this issue. Until upgraded, restrict network access to port 3444 to trusted hosts only and avoid running the Studio server in untrusted environments. There is no official patch or temporary fix other than upgrading. No vendor advisory content is provided to indicate alternative mitigations or that no action is required.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-08-11T14:41:20.122Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 6a7b6d43bf8831d5393361b5

Added to database: 08/11/2026, 18:43:15 UTC

Last enriched: 08/11/2026, 19:11:57 UTC

Last updated: 09/25/2026, 22:10:18 UTC

Views: 79

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses