fix(sandbox): sanitize Docker env before marking OPENCLAW_CLI#42256
fix(sandbox): sanitize Docker env before marking OPENCLAW_CLI#42256vincentkoc merged 6 commits intomainfrom
Conversation
Greptile SummaryThis PR fixes a call-site ordering bug in Key changes:
Minor test coverage note: The new Confidence Score: 4/5
Last reviewed commit: aa3f7aa |
|
Addressed the Windows Docker spawn concern in the latest update.
Verification:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eabeff6e0f
ℹ️ 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".
…aw#42256) * Sandbox: sanitize Docker env before exec marker injection * Sandbox: add regression test for Docker exec marker env * Sandbox: disable Windows shell fallback for Docker * Sandbox: cover Windows Docker wrapper rejection * Sandbox: test strict env sanitization through Docker args
…aw#42256) * Sandbox: sanitize Docker env before exec marker injection * Sandbox: add regression test for Docker exec marker env * Sandbox: disable Windows shell fallback for Docker * Sandbox: cover Windows Docker wrapper rejection * Sandbox: test strict env sanitization through Docker args
…aw#42256) * Sandbox: sanitize Docker env before exec marker injection * Sandbox: add regression test for Docker exec marker env * Sandbox: disable Windows shell fallback for Docker * Sandbox: cover Windows Docker wrapper rejection * Sandbox: test strict env sanitization through Docker args
…aw#42256) * Sandbox: sanitize Docker env before exec marker injection * Sandbox: add regression test for Docker exec marker env * Sandbox: disable Windows shell fallback for Docker * Sandbox: cover Windows Docker wrapper rejection * Sandbox: test strict env sanitization through Docker args
…aw#42256) * Sandbox: sanitize Docker env before exec marker injection * Sandbox: add regression test for Docker exec marker env * Sandbox: disable Windows shell fallback for Docker * Sandbox: cover Windows Docker wrapper rejection * Sandbox: test strict env sanitization through Docker args
* main: (49 commits) fix(agents): add nodes to owner-only tool policy fallbacks fix(gateway): propagate real gateway client into plugin subagent runtime fix(gateway): enforce caller-scope subsetting in device.token.rotate fix(terminal): stabilize skills table width across Terminal.app and iTerm (openclaw#42849) fix(models): guard optional model input capabilities (openclaw#42096) macOS/onboarding: prompt for remote gateway auth tokens (openclaw#43100) fix(macos): use foundationValue when serializing browser proxy POST body (openclaw#43069) feat(ios): add local beta release flow (openclaw#42991) docs(changelog): update context pruning PR reference fix(context-pruning): cover image-only tool-result pruning fix(context-pruning): prune image-containing tool results instead of skipping them (openclaw#41789) fix(agents): include azure-openai in Responses API store override (openclaw#42934) fix(telegram): fall back on ambiguous first preview sends fix(telegram): prevent duplicate messages with slow LLM providers (openclaw#41932) Providers: add Opencode Go support (openclaw#42313) fix(sandbox): sanitize Docker env before marking OPENCLAW_CLI (openclaw#42256) macOS: add chat model selector and persist thinking (openclaw#42314) fix: clear pnpm prod audit vulnerabilities fix(build): restore full gate fix(gateway): split conversation reset from admin reset ...
…aw#42256) * Sandbox: sanitize Docker env before exec marker injection * Sandbox: add regression test for Docker exec marker env * Sandbox: disable Windows shell fallback for Docker * Sandbox: cover Windows Docker wrapper rejection * Sandbox: test strict env sanitization through Docker args
…aw#42256) * Sandbox: sanitize Docker env before exec marker injection * Sandbox: add regression test for Docker exec marker env * Sandbox: disable Windows shell fallback for Docker * Sandbox: cover Windows Docker wrapper rejection * Sandbox: test strict env sanitization through Docker args
…aw#42256) * Sandbox: sanitize Docker env before exec marker injection * Sandbox: add regression test for Docker exec marker env * Sandbox: disable Windows shell fallback for Docker * Sandbox: cover Windows Docker wrapper rejection * Sandbox: test strict env sanitization through Docker args
…aw#42256) * Sandbox: sanitize Docker env before exec marker injection * Sandbox: add regression test for Docker exec marker env * Sandbox: disable Windows shell fallback for Docker * Sandbox: cover Windows Docker wrapper rejection * Sandbox: test strict env sanitization through Docker args
…aw#42256) * Sandbox: sanitize Docker env before exec marker injection * Sandbox: add regression test for Docker exec marker env * Sandbox: disable Windows shell fallback for Docker * Sandbox: cover Windows Docker wrapper rejection * Sandbox: test strict env sanitization through Docker args
…aw#42256) * Sandbox: sanitize Docker env before exec marker injection * Sandbox: add regression test for Docker exec marker env * Sandbox: disable Windows shell fallback for Docker * Sandbox: cover Windows Docker wrapper rejection * Sandbox: test strict env sanitization through Docker args
…aw#42256) * Sandbox: sanitize Docker env before exec marker injection * Sandbox: add regression test for Docker exec marker env * Sandbox: disable Windows shell fallback for Docker * Sandbox: cover Windows Docker wrapper rejection * Sandbox: test strict env sanitization through Docker args (cherry picked from commit bd33a34)
…aw#42256) * Sandbox: sanitize Docker env before exec marker injection * Sandbox: add regression test for Docker exec marker env * Sandbox: disable Windows shell fallback for Docker * Sandbox: cover Windows Docker wrapper rejection * Sandbox: test strict env sanitization through Docker args
…aw#42256) * Sandbox: sanitize Docker env before exec marker injection * Sandbox: add regression test for Docker exec marker env * Sandbox: disable Windows shell fallback for Docker * Sandbox: cover Windows Docker wrapper rejection * Sandbox: test strict env sanitization through Docker args
Summary
OPENCLAW_CLIbefore env sanitization, unlike the other execution paths from feat(exec): mark child command env with OPENCLAW_CLI #41411.strictMode, the sanitizer would block the marker and log it as a blocked variable; on Windows, Docker also allowed ashell: truefallback for unresolved wrapper shims.markOpenClawExecEnvis applied immediately before emitting--envargs; Docker Windows resolution now refuses shell fallback and requires a direct executable or resolvable Node entrypoint; the regression tests now cover the strict-mode integration path and unresolved Windows wrapper rejection.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
docker.cmd/.batwrapper.Security Impact (required)
No)No)No)Yes)No)Yes, explain risk + mitigation: Docker no longer permits Windows shell fallback, which removes a shell-execution path for user-influenced Docker args. The compatibility tradeoff is limited to unresolved wrapper setups, which now fail with an explicit error instead of invokingcmd.exe.Repro + Verification
Environment
env.NODE_ENV=testSteps
envSanitizationOptions.strictMode=trueandenv.NODE_ENV=test.--envargs still includeOPENCLAW_CLIafter sanitization.docker.cmd, resolve the Docker spawn invocation.Expected
OPENCLAW_CLIis appended after sanitization and survives strict-mode filtering.shell: truefallback.Actual
OPENCLAW_CLIafter strict sanitization, and rejects unresolved Windows wrappers instead of shelling out.Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
pnpm test -- src/agents/sandbox-create-args.test.ts src/agents/sandbox/docker.windows.test.ts;pnpm exec oxfmt --check src/agents/sandbox/docker.ts src/agents/sandbox/docker.windows.test.ts src/agents/sandbox-create-args.test.ts;pnpm exec oxlint src/agents/sandbox/docker.ts src/agents/sandbox/docker.windows.test.ts src/agents/sandbox-create-args.test.tsdocker.cmdwrappers are rejected instead of enablingshell: true.pnpm checkis currently failing on unrelatedmainbranch TypeScript errors in other agent/OAuth files.Review Conversations
Compatibility / Migration
Mostly)No)Maybe)docker.cmd/.batshim need Docker installed in a form that resolves to a direct executable or a resolvable Node entrypoint.Failure Recovery (if this breaks)
src/agents/sandbox/docker.ts,src/agents/sandbox/docker.windows.test.ts,src/agents/sandbox-create-args.test.tsOPENCLAW_CLIunder strict sanitization, or Windows Docker startup failing because only an unresolved wrapper is available.Risks and Mitigations
cmd.exeand surfaces a direct remediation path.