Repository navigation
[OpenClaw #4702] Harden Windows binary detection and command execution - #419
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 30ee377078
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| cwd, | ||
| env: resolvedEnv, | ||
| windowsVerbatimArguments, | ||
| shell: process.platform === "win32", |
There was a problem hiding this comment.
Stop forcing cmd.exe for all Windows subprocesses
runCommandWithTimeout now unconditionally enables shell on Windows, which makes cmd.exe parse every argument instead of passing argv entries through verbatim. That changes behavior for existing call sites that forward user-provided strings (for example, plugins-cli passes raw CLI input into installPluginFromNpmSpec, which executes npm pack <spec>), so metacharacters like ^, &, |, and % are interpreted by the shell rather than treated as data. This regresses prior direct-spawn semantics and can both break valid inputs (e.g. semver range specs) and introduce command-injection risk on Windows.
Useful? React with 👍 / 👎.
Summary
hasBinarychecks in skills/hooks config to respect WindowsPATHEXTcandidatesrunCommandWithTimeoutby stringifying values and droppingundefinedshellspawning on Windows inrunCommandWithTimeoutfor command execution parityTesting
cd packages/zee/Swabble && bunx vitest run src/process/exec.test.tsFixes #344