Security

claude-code-templates: unauthenticated RCE in the --studio server

claude-code-templates --studio (Claude Code Studio) sandbox server - binds to all interfaces, sends wildcard CORS and passes request fields to spawn with shell:true, giving unauthenticated remote code execution from the network or any web page (GHSA-966p-38c9-q2p7)

PUBLISHED SEVERITY HIGHSTATUS PatchedGHSA-966p-38c9-q2p7
Patched

Fixed in claude-code-templates 1.29.4 (2026-07-14) by commit bc4618b, which drops shell:true, validates agent names, binds the server to 127.0.0.1 and rejects cross-origin requests. 1.31.0 (2026-11-02) removes --studio and its server entirely. Track the fix at davila7/claude-code-templates@bc4618b.

Product
claude-code-templates (npm), Claude Code Studio (--studio) in davila7/claude-code-templates
Affected versions
claude-code-templates from the addition of --studio (September 2025) through 1.29.2 (npm, 2026-06-13). Fixed in 1.29.4 (2026-07-14); --studio removed in 1.31.0 (2026-11-02).
Severity
HIGH
Status
Patched
Weaknesses
  • CWE-78Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
  • CWE-352Cross-Site Request Forgery (CSRF)
  • CWE-942Permissive Cross-domain Policy with Untrusted Domains
CWE-78, CWE-352 and CWE-942 as filed on GHSA-966p-38c9-q2p7.
GitHub advisory
GHSA-966p-38c9-q2p7
Private; still in triage. Reported in parallel with GHSA-79wm-x847-7cvg, which the maintainer published on 2026-07-14
CVE
CVE-2026-73222 (assigned to the parallel report GHSA-79wm-x847-7cvg)
Published
Credit
Finder: Aaron Elijah Mars of Aeon. Tool: Aeon (https://www.aeon.fun).

What users should do now

Upgrade to 1.29.4 or later, and preferably to 1.31.0 or later, where --studio no longer exists. npx claude-code-templates@latest already picks up a fixed version.

  1. If you have a global or pinned install, check it with npm ls -g claude-code-templates (or your lockfile) and update anything at 1.29.2 or below.
  2. Stop any claude-code-templates --studio process still running from an old version; the fix only applies once the server is restarted from a fixed release.
  3. If you ran --studio on an old version on a shared network, or browsed untrusted sites while it was running, check the folder it was started in and your shell history for changes you did not make, and rotate the API keys in that folder's .env, since the server loaded them into its environment.

Summary

--studio launched cli-tool/src/sandbox-server.js, an Express server on port 3444 that runs Claude Code tasks and installs agents for the Studio web UI. Three choices combined into remote code execution: the server was started with app.listen(PORT) and no host, so it listened on every interface; a middleware sent Access-Control-Allow-Origin: * and approved every preflight, so any web page could send it JSON; and POST /api/execute and POST /api/install-agent handed the prompt and agentName fields to spawn(..., { shell: true }). With shell: true, Node joins the command and its arguments into one string and runs it through /bin/sh -c, so shell metacharacters in those fields ran as commands. No token or login was checked on any route.

Two reports of this bug were made independently, in parallel: ours (GHSA-966p-38c9-q2p7, filed 2026-07-13) and one by spartan8806, which the maintainer published as GHSA-79wm-x847-7cvg. The CVE assigned to this bug is CVE-2026-73222, issued through that advisory; there is no separate CVE for our report.

Affected versions

Every npm release that shipped --studio, from its addition in September 2025 through 1.29.2 (2026-06-13), as listed on the maintainer's advisory (GHSA-79wm-x847-7cvg, <= 1.29.2). 1.29.3 was never published to npm. Fixed in 1.29.4 (2026-07-14). #1351 (1.31.0, 2026-11-02) removes --studio, --sandbox and the server file, so current releases do not contain this code at all. Only users who ran --studio were exposed; the other commands of the CLI do not start this server.

Impact

While --studio was running, there were two ways in, neither needing credentials:

  • From the network. Any host that could reach TCP 3444 (a LAN or Wi-Fi peer, a VPN, a co-located container or VM, a shared CI host) could send the request directly, with no action from the user.
  • From a web page. Any site the user visited could send a cross-origin fetch() to http://localhost:3444. The wildcard CORS headers approved the preflight, so the browser delivered the real POST. The page did not need to read the reply.

The commands ran as the user in the folder Studio was started from, with the server's environment, which includes any API keys it loaded from that folder's .env at startup. That is full control of the user's account on that machine. A working exploit is withheld.

Affected code

Permalinks at acdb589, the parent of the fix commit.

Fix

  • Commit bc4618b (merged 2026-07-14 from the maintainer's private fork for GHSA-79wm-x847-7cvg, shipped in 1.29.4) removes shell: true from all three spawns, so prompt and agentName stay single argv entries that no shell parses. On Windows it calls the npx.cmd and claude.cmd shims directly instead of turning the shell back on.
  • agentName and agent must match ^[A-Za-z0-9._/-]+$ before they reach any child process.
  • The server listens on 127.0.0.1 only, which closes the network path.
  • CORS is limited to the Studio UI's own localhost and 127.0.0.1 origins, and requests from any other origin are rejected with 403, which closes the web page path.
  • #1351 (1.31.0) later removes --studio and sandbox-server.js altogether.

Disclosure timeline

  1. Vulnerability reported privately via GitHub Security Advisory (GHSA-966p-38c9-q2p7), with a suggested fix. Another researcher reported the same issue independently, in parallel.
  2. Fix commit bc4618b merged and 1.29.4 published to npm; the maintainer publishes the parallel report as GHSA-79wm-x847-7cvg (CVE-2026-73222). GHSA-966p-38c9-q2p7 stays in triage.
  3. First follow-up comment posted on the advisory: fix re-verified at HEAD, advisory ready to publish (66 days in triage).
  4. Second follow-up comment posted, asking the maintainer to publish the advisory and request a CVE (88 days in triage).
  5. #1351 merged and 1.31.0 published, removing --studio and its server.
  6. Final follow-up comment posted on the advisory; no reply from the maintainer (113 days in triage).
  7. Public write-up.

Credit

Finder: Aaron Elijah Mars of Aeon. Tool: Aeon.

The same issue was reported independently, in parallel, by spartan8806, credited on GHSA-79wm-x847-7cvg. Fix by spartan8806 and the maintainer, davila7.

References