Claude Code Templates: Unauthenticated OS command injection (RCE) in Claude Code Studio server (--studio)
概要
Claude Code Templates: Unauthenticated OS command injection (RCE) in Claude Code Studio server (--studio)
原文の説明
取得元が公開している説明をそのまま載せています (多くは英語)。
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 f…
出典: NIST National Vulnerability Database NVD GitHub Advisory
AI要約
外部の AI が作成した要約です。誤りを含むことがあります。重要な判断の前に、下の原文と参照URLを確認してください。
Claude Code Templatesの脆弱性により、バージョン1.29.4以前では、--studioオプションを使用して起動するサーバーがポート3444で全インターフェースにバインドされ、クロスオリジンリクエストが許可され、認証が不要です。これにより、悪意のある攻撃者はOSコマンドを任意に実行でき、開発者の特権でソースコードや資格情報、ローカルデータを危険にさらす可能性があります。
Claude Code TemplatesのCLIツールの脆弱性。
バージョン1.29.4以前のClaude Code Studioのサーバー。
攻撃者が任意のOSコマンドを実行できるため、システムの完全な制御が可能となり、高度なリスクがあります。
バージョン1.29.4にアップデートすること。
情報なし
ポート3444で不審なアクセスを監視し、意図しないシェル実行を確認する。
影響パッケージ
参照URL
- web github.com
- web github.com
- web github.com
- web nvd.nist.gov
- web github.com