fix(exec): detect cmd wrapper carriers#62439
Conversation
Greptile SummaryThe PR fixes a Windows allowlist bypass where Confidence Score: 5/5Safe to merge; the fix narrows execution by restoring the intended cmd.exe approval gate for transparent carrier wrappers. The change is minimal and correct: No files require special attention. Reviews (1): Last reviewed commit: "fix(exec): detect cmd wrapper carriers" | Re-trigger Greptile |
8aa85ba to
4b4ed34
Compare
|
Landed via temp rebase onto main.
Thanks @ngutman! |
* fix(exec): detect cmd wrapper carriers * fix(exec): block env cmd wrapper carriers * fix: keep cmd wrapper carriers approval-gated (openclaw#62439) (thanks @ngutman)
* fix(exec): detect cmd wrapper carriers * fix(exec): block env cmd wrapper carriers * fix: keep cmd wrapper carriers approval-gated (openclaw#62439) (thanks @ngutman)
* fix(exec): detect cmd wrapper carriers * fix(exec): block env cmd wrapper carriers * fix: keep cmd wrapper carriers approval-gated (openclaw#62439) (thanks @ngutman)
* fix(exec): detect cmd wrapper carriers * fix(exec): block env cmd wrapper carriers * fix: keep cmd wrapper carriers approval-gated (openclaw#62439) (thanks @ngutman)
Summary
cmd.exetransport wrappers from the original argv only, so transparent carriers likeenv cmd.exe /c ...were missed.cmd.exe /cwhen the inner payload was otherwise allowlisted.system.runnow checkscmd.exewrapper transport after unwrapping transparent dispatch wrappers, and adds a regression test forenv cmd.exe /c ....Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
cmdInvocationinsrc/node-host/invoke-system-run.tsonly inspected the original request argv, while shell-wrapper parsing already unwraps transparent dispatch wrappers before identifyingcmd.exe /c.cmd.exewrappers behind a transparent carrier likeenv.cmd.exe /cwrappers approval-gated, but the transport classification path and shell-wrapper parsing path drifted.Regression Test Plan (if applicable)
src/node-host/invoke-system-run.test.tsenv cmd.exe /d /s /c <allowlisted script>still requires approval in Windows allowlist mode.cmd.exe /c ...approval gating was already covered.User-visible / Behavior Changes
system.runrequests wrapped by transparent carriers likeenvnow keep the intendedcmd.exe /capproval gate.Diagram (if applicable)
Security Impact (required)
Yes, explain risk + mitigation: this narrows execution by restoring the intended approval requirement for a Windows wrapper edge case; regression coverage locks it in.Repro + Verification
Environment
tools.exec.security=allowlist,tools.exec.ask=on-missSteps
.cmdscript path.system.runwithenv cmd.exe /d /s /c <script> --limit 5in allowlist mode.Expected
Actual
cmd.exeand auto-run.Evidence
Human Verification (required)
cmd.exe /c ...gating still passes, and the newenv cmd.exe /c ...regression test now denies execution without approval.cmd.exedetection only; no POSIX transport-wrapper assertions changed.pnpm checkon the pre-fix commit path, since an unrelatedtsgofailure on currentmainblocked the first commit attempt; reran the touched-surface tests after rebasing onto latestorigin/main.Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Risks and Mitigations
cmd.exedetection could over-classify non-transparent carriers.