Skip to content

fix(channel): resolve .exe path from npm .cmd shim on Windows#352

Open
wsolarq11 wants to merge 1 commit into
mindfold-ai:mainfrom
wsolarq11:fix/channel-spawn-windows
Open

fix(channel): resolve .exe path from npm .cmd shim on Windows#352
wsolarq11 wants to merge 1 commit into
mindfold-ai:mainfrom
wsolarq11:fix/channel-spawn-windows

Conversation

@wsolarq11

Copy link
Copy Markdown
Contributor

Fixes #348

spawn("claude") fails on Windows because npm puts only a .cmd shim in PATH, not the real .exe. Node.js >=18.20.2 (CVE-2024-27980) blocks implicit .cmd execution without shell: true. Using shell: true would reintroduce the injection vector -- the args carry --append-system-prompt content.

Instead, parse the npm-generated .cmd shim to find the real .exe, then spawn it directly. No shell, no injection risk.

Change: packages/cli/src/commands/channel/supervisor.ts

  • +resolveProviderPath() utility

  • 2 lines modified at the spawn call

  • 0 import changes, 0 new dependencies

  • No effect on macOS/Linux (process.platform guard)

  • Fixes both claude and codex adapters

  • Falls back to original provider if resolution fails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

channel spawn fails on Windows — spawn("claude") ENOENT after Node.js CVE-2024-27980

1 participant