Skip to content

Commit c9608c8

Browse files
calebedenCopilotshanselman
authored
fix: honor exec allowlists for Windows node commands (#1109)
* fix: align exec approval snapshot schema Omit the redundant baseHash response field so file-backed V2 snapshots match the gateway protocol. Keep hash as the compare-and-swap value supplied to system.execApprovals.set. Co-authored-by: Copilot App <[email protected]> * fix: bind reusable Windows exec commands Bind simple canonical CMD carriers to one resolved executable identity for allowlist matching, persistence, metadata, and direct execution. Keep shell syntax and ambiguous command forms on the one-time approval path. Co-authored-by: Copilot App <[email protected]> * fix: harden reusable exec host checks Keep argument-selected Windows code hosts on the one-time approval path, document the maintained host catalog, and enforce the reusable-command prerequisite for durable fallback execution. Co-authored-by: Copilot App <[email protected]> * fix: correct carrier recognition and tighten reusable exec binding Review follow-ups for the reusable exec command binder. Carrier shape (blocker): the binder only accepted a cmd carrier with exactly 5 argv elements, but the gateway sends the command tail already tokenized (upstream fixture: cmd.exe /d /s /c echo "SAFE&&whoami"), so real invocations never bound and allowlists stayed broken. Carrier recognition now lives in a single owner, CanonicalCmdCarrier, which accepts multi-element tails and identifies cmd by basename so the absolute-path form works. MxcConfigBuilder now shares that owner instead of keeping its own divergent copy, which also removes a latent NotSupportedException on carriers with more than 5 elements. Bindable executables (high): PATHEXT resolution can return .vbs, .js, .msc, .com and similar, so a denylist of .bat/.cmd was insufficient for durable rules. Replaced with an .exe-only allowlist, applied in both the binder and the coordinator. Prompt resolved path (high): ExecApprovalEvaluation.Resolution is derived from the allowlist resolutions, which are now empty for unbindable commands, so the approval dialog lost the resolved path on exactly the riskiest path. Restored a fallback to the carrier resolution. Indirect command hosts: corrected the inaccurate claim that this catalog matches the macOS binding model (macOS binds an argPattern instead) and expanded it with 20 argument-selected code hosts. Also documents why baseHash must not be reintroduced into the exec approvals snapshot, records the new ownership in the architecture ledger with guard tests, and documents the interpreter-rule behavior change. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1223ff2c-11b6-48d9-937b-a56408e99b93 * fix: only look through a trusted system cmd carrier Rubber-duck review caught an approval/execution identity mismatch that the previous commit introduced. Unifying carrier recognition on a basename match let any image named cmd.exe be looked through, including a copy in a writable directory. For "C:\Writable\cmd.exe /d /s /c hostname.exe" the binder would bind against the inner hostname.exe, so the approval dialog showed that trusted path, but an allow-once still launches the outer image, which is free to ignore its arguments and run something else entirely. The two owners need different predicates. Serialization must stay permissive: cmd parses its own raw command line rather than going through CommandLineToArgvW, so anything cmd receives has to use the cmd-aware serializer regardless of where the image lives, and being permissive there only ever yields correct quoting. Trust must be strict, because looking through a carrier is what makes the shown identity differ from the executed image. IsCmdExecutable stays as the serialization predicate and keeps its MxcConfigBuilder caller. IsTrustedCarrierExecutable is new and accepts only the bare gateway name or a fully-qualified path in the Windows system directories; the binder now uses TryGetTrustedCanonicalPayload. An unrecognized carrier falls through to the existing indirect-host rejection, so it stays unbindable instead of binding to the wrong identity. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1223ff2c-11b6-48d9-937b-a56408e99b93 * fix: verify resolved cmd carrier identity Require durable binding to resolve the outer carrier to system cmd.exe, restore native .com executables, preserve .com command-host classification, and clarify the live gateway carrier shape. Co-authored-by: Copilot App <[email protected]> * fix(exec-approvals): bind durable approvals to arguments, not executable names Durable approval identity is now executable path plus an argument pattern, matching the gateway protocol and the macOS node. Approving one invocation of a program no longer authorizes every other invocation of it. Upstream ground truth is openclaw/openclaw at db90dff1396fecbf7029e9e9ea19d6c6ca3e644e: packages/gateway-protocol/src/schema/exec-approvals.ts, src/infra/exec-approvals-allowlist.ts, src/infra/exec-command-resolution.ts, src/infra/system-run-command.ts. Argument binding (D1) ExecArgPattern owns the wire format. A generated pattern is an anchored regex over the NUL-separated argument subject, matching buildArgPatternFromArgv on Windows. The macOS hashed "sha256:argv:" form is recognized so an entry created there matches here. Patterns are remote-influenced input, so matching is time bounded and a malformed pattern fails closed. ExecAllowlistMatcher now mirrors matchAllowlist: an entry with an argument pattern must match the arguments and wins over a path-only match; a generated entry with no argument pattern never matches, because such an entry predates argument binding and would authorize argv the operator never saw. The name-keyed interpreter catalog in ExecCommandToken is deleted. A name list is not a boundary: renaming an image defeats it and the list can never be complete. Argument binding constrains a renamed interpreter exactly as tightly. rawCommand consistency (D2) ValidatedRunRequest carries rawCommand and the validator rejects a mismatch against command, mirroring the gateway's RAW_COMMAND_MISMATCH. Both accepted forms are honored: the formatted argv and the inline cmd payload. rawCommand is never promoted to executable input. Network executables (D3) A durable rule names a path, not the bytes at that path. UNC and mapped network paths are refused for durable binding because whoever controls the share controls what a past approval authorizes later. Carrier diagnostics (D4) An unbindable carrier now reports why (non-canonical-cmd-carrier, carrier-payload-not-static, untrusted-cmd-carrier-image, and so on) instead of silently producing an allowlist that appears to be ignored. Identity separated from transport (D5) A strictly recognized canonical cmd carrier is authorized by the executable it actually runs, but is executed exactly as received. Substituting the bound direct argv would drop the carrier's in-band PATH and TEMP setup, which is the only environment contract the sandbox currently accepts. An invariant asserts the executed transport still reconstructs the approved request. Images merely named cmd.exe are refused: looking through one would describe the trusted inner program while running the untrusted outer image. Also fixes a real widening bug: rewriting the approvals file dropped source and argPattern, silently converting a narrow generated rule into a path-only one. Behavior change worth calling out: a hand-written path-only rule such as **/wsl.exe now authorizes that executable instead of hard-failing with persistent-approval-not-permitted-for-command-host. That matches upstream and is the operator's explicit choice. Generated rules still pin their arguments. Validation: build.ps1, Shared 3502, Tray 2116, WinNode.Cli 126. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1223ff2c-11b6-48d9-937b-a56408e99b93 * fix(exec-approvals): execute trusted carriers via resolved System32 path The D5 carrier-preservation path kept the request's original argv[0], which is typically a bare `cmd.exe`. LocalCommandRunner.ValidateDirectExecutable requires a fully-qualified executable, so every preserved carrier failed at launch, and a relative argv[0] would also let Windows re-resolve the image against PATH/cwd at spawn time - the exact hijack the resolved-path rule exists to prevent. CanonicalCmdCarrier.ResolveTrustedCarrierPath now resolves a trusted carrier token to the absolute System32/SysWOW64 cmd.exe, and the binder pins executionArgv[0] to it. The anti-drift invariant in CarrierTransportMatchesRequest permits exactly that one substitution (argv[0], compared OrdinalIgnoreCase); argv[1..] must still be Ordinal-identical, so no metacharacter drift can be introduced. A carrier that cannot be resolved to a trusted image is rejected with UntrustedCarrierImage. E2E: adds a multi-element-tail allowlist proof matching the gateway's real wire shape, plus a child-spawn diagnostic. Both approval proofs now assert the approval decision unconditionally and tolerate only STATUS_DLL_INIT_FAILED for the exit code, since some hosts cannot spawn any child executable under MXC. Any other nonzero exit still fails. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1223ff2c-11b6-48d9-937b-a56408e99b93 * docs+test: document argPattern identity model and prove CAS stale-hash rejection WINDOWS_NODE_ARCHITECTURE still described the removed indirect-command-host catalog as the durable security boundary. Replaced with the implemented model: durable identity is executable + argPattern, the platform-specific argPattern wire form, upstream matchAllowlist authorization consequences, the trusted-carrier identity/transport split and its two anti-drift invariants, and the deliberate path-only policy loosening. Adds an architecture ledger row for exec-carrier-transport-identity so a future change cannot quietly substitute the bound direct argv for the carrier while MXC still needs the in-band PATH/TEMP bootstrap. Adds SystemExecApprovals_SetRejectsStaleBaseHash over the real MCP HTTP server: the GET snapshot carries no baseHash, a stale baseHash on .set is rejected, and the rejected write does not mutate the file. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1223ff2c-11b6-48d9-937b-a56408e99b93 * fix: close three authorization holes in exec approval binding Three ways a durable approval could authorize one thing and permit another. Current-directory hijack. The trusted cmd carrier is executed verbatim, so cmd.exe re-resolves the payload executable at launch and it searches the current directory before PATH. Our resolver searches PATH only. A file named like the payload sitting in the working directory therefore meant the binder authorized the PATH copy while cmd.exe launched the local one, and a replay re-resolved to the same PATH copy so no prompt appeared. The binder now refuses to bind when the current directory shadows a bare payload name, so the two resolvers can never disagree. Explicitly relative payloads are unaffected: both resolve them the same way. Remote binding strip. A remote .set was allowed to retain any entry whose pattern matched an existing one. Keeping the path while dropping argPattern and source converted a narrow generated rule into a path-only grant for that executable, which is privilege escalation without adding an entry. Retention now compares the whole authorization identity. NUL in arguments. NUL separates arguments inside a persisted argPattern, so "a\0b" rendered identically to the two arguments "a","b" and a stored rule could match a differently segmented argv. NUL is not representable in a Windows command line anyway, so arguments containing one are rejected before anything is bound or written. Also stamps allowlist usage against the matched entry id and argument binding rather than the pattern alone, so a path-only rule no longer absorbs the usage metadata of a bound sibling, and logs the breadth of each grant. Validation: build.ps1; Shared 3508 passed; Tray 2116 passed; WinNode.Cli 126 passed; MCP exec-approvals integration 4 passed against a live tray subprocess. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1223ff2c-11b6-48d9-937b-a56408e99b93 * fix: harden the exec approval authorization checks against bypass Follow-up review found three ways around the checks added in the previous commit. Identity forgery. The retained-entry identity joined pattern, argPattern and source with NUL, but argPattern legitimately contains NUL. A caller could shift the delimiter between fields to forge a match while leaving a broader, unanchored regex behind: (argPattern "^--version\0$", source "allow-always") had the same joined form as (argPattern "^--version", source "$\0allow-always"). The fields are now compared structurally, so no redistribution can collide. Omitted working directory. The current-directory shadow check treated a null cwd as "no current directory", but a child process inherits this one's and cmd.exe searches it before PATH just the same. It now falls back to the inherited directory instead of skipping the check. Carrier payload NUL. The NUL rejection sat in the direct-binding path only. The carrier tokenizes a payload string into a fresh argv, so a NUL carried inside the payload was checked but the outer command was not. The check now runs at entry, before any carrier parsing, and again after tokenization. Validation: build.ps1 (WinNodeCli hit the known transient GitVersion mutex error; rebuilt clean on retry); Shared 3510 passed; Tray 2116 passed; WinNode.Cli 126 passed; MCP exec-approvals integration 5 passed against a live tray subprocess rebuilt from this head. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1223ff2c-11b6-48d9-937b-a56408e99b93 * docs: record the carrier payload resolution rule and its residual risk Documents the working-directory ambiguity refusal, the NUL argument rule, and the structural retained-entry identity comparison. Also states plainly that the ambiguity check is an approval-time snapshot, so a writable working directory remains in scope for payload substitution until the transport question is settled. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1223ff2c-11b6-48d9-937b-a56408e99b93 * fix: hash retained-entry identities to keep the remote set check bounded The structural comparison introduced in the previous commit replaced a hash set with a linear scan. The submitted allowlist is remote-controlled, so a caller could pass the retention constraint with many duplicate entries and force a full scan of the local allowlist for each one. Restores hashed lookup with a structural tuple comparer, so collision safety does not cost bounded lookup. Source-only commit. Not validated locally: coordinator holds the host. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1223ff2c-11b6-48d9-937b-a56408e99b93 * fix: quarantine legacy command-host rules and pin the trusted cmd carrier D6, targeted quarantine. An allowlist entry with neither `source` nor `argPattern` stays a valid path-only rule for an ordinary executable, but goes inert when its resolved target is a wrapper, interpreter, or code host the previous model refused to approve durably (python, cmd, powershell, pwsh, wsl and the rest of the pre-existing catalog, including versioned interpreters). Those commands prompt instead of matching. The entry is not deleted and is not auto-migrated on first observation. Only an explicit Allow always writes a source-marked, argument-bound sibling, which then matches normally. This keeps the move from a name catalog to argument binding from silently loosening a case that used to be denied outright. The catalog is a legacy-compatibility predicate, not the security boundary; structural wrapper classification plus argument binding remains the model. D7, constrained Option A. The recognized canonical trusted cmd carrier is still executed (its in-band PATH and TEMP bootstrap is required under MXC 0.7, which rejects a non-empty process.env), but it is reconstructed with the payload's executable token pinned to the binder-resolved absolute path, in addition to the already-pinned argv[0]. This closes the working-directory substitution race: without the pin, the binder authorizes using a PATH-only resolver while cmd resolves the same token at launch searching the working directory first, so anything able to write there between approval and launch picked the winner. New `CmdPayloadTokenizer` is the single owner of payload parsing and exposes token spans, so the rewrite is built from the parsed structure and never from a string replacement. An argument that repeats the executable's text survives untouched. Pinning is refused rather than approximated: the pinned path must be readable back by cmd byte for byte, so whitespace, quotes, control characters, `% ! ^ & | < > ( )`, the command-name delimiters `, ; =`, and a trailing backslash all fail closed to prompt-only. Whitespace is refused rather than quoted because under `/s` cmd strips the payload's first and last quote and uses the remainder verbatim, which would reintroduce the ambiguity the pin exists to remove. Reconstruction is validated by round trip: same argument count, the executable equal to the pinned path, every other argument ordinal-identical, tail arity preserved, and the whole carrier still recognized as canonical. The same equivalence is re-checked at execution time. The approval-time working-directory ambiguity check is demoted to a diagnostic and the residual race is removed from the docs. Reconciles remote contributor head b9be5f4: - Adopted: `.com` is a directly-executable image, so it is bindable and is stripped by NormalizedBasename (so powershell.com classifies like powershell.exe). - Adopted: the doc clarification that the live gateway sends one pre-joined tail element and a tokenized tail is a low-level/fixture shape. - Superseded: `IsTrustedSystemCmdPath` detected a bare cmd.exe resolving outside System32 and refused to bind. Pinning is strictly stronger: argv[0] is set to the system image, so a rogue cmd.exe first on PATH is not merely detected, it is never what runs. The weaker predicate must not be resurrected. The test that protected the invariant is preserved in strengthened form. NOT VALIDATED. No build, test, or tool run was performed for this commit: the coordinator holds an exclusive local host lock. Source only, pending the `1109 LOCAL WINDOW START` window. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1223ff2c-11b6-48d9-937b-a56408e99b93 * test: harden pinned-carrier coverage and reconcile .com classification Adds focused CanonicalCmdCarrier coverage for the D7 reconstruction: the request's own switch spelling is preserved, a relative carrier or payload is refused, the pinned carrier matches the request it was built from, any other difference (different program, different argument, injected metacharacter, unqualified payload, changed switch) is refused at execution time, and the PATHEXT extension a bare name gains when resolved is accepted. Refuses pinning a path containing cmd's command-name delimiters , ; = which our tokenizer deliberately does not model, so such a path cannot be split by cmd into a different program plus an argument. Adds the three cases to the representation-safety theory. Avoids nullable/variance-sensitive assertion overloads and collection expressions in generic Assert.Equal calls, since tests build with TreatWarningsAsErrors. NOT VALIDATED. Source only, local host hold still in force. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1223ff2c-11b6-48d9-937b-a56408e99b93 * fix: keep durable binding .exe-only and verify pinned payloads by reconstruction Two coordinator-required corrections to the D6/D7 work. All other D6/D7 behavior is unchanged. 1. Revert the .com durable bindability expansion. b9be5f4 proposed treating .com as bindable alongside .exe, and that was adopted in 4f8252c. It is reverted here. Widening the durable authorization allowlist to another executable format is a separate decision with its own review, and it is out of scope for a change about carrier binding. IsBindableExecutable is .exe only again, and .com rejoins the non-bindable PATHEXT set. NormalizedBasename still strips .com, for one narrow reason that is now documented at the call site: IsLegacyQuarantinedHost has to recognize a provenance-less legacy entry naming powershell.com exactly as it recognizes powershell.exe, otherwise the D6 change in model would silently upgrade a case the old catalog refused outright. That is quarantine classification, not bindability. Both halves now have focused tests (NativeComExtensionTarget_DoesNotBind for the contract, ComExtension_QuarantinesAsTheSameCommandHostAsExe and LegacyPathOnlyEntryForACommandHostWithComExtension_IsInert for the transitional behavior). 2. Verify the pinned payload by reconstruction, not token comparison. PinnedCarrierMatchesRequest documented that all interior spacing must be byte-identical, but it only compared token values. A payload whose tokens matched while its spacing was rewritten passed. It now reconstructs the one payload the request is permitted to have become, by applying the executable token span edit to the request's own payload, and requires ordinal equality with the payload actually being executed. That single check subsumes argument values, argument count, and every byte of interior spacing. PinnedCarrier_RejectsInteriorSpacingChangesThatPreserveTokens covers a doubled space, a tab, a leading space, and a trailing space. Each asserts the tokens are still identical before asserting the match fails, so the rejection is attributable to spacing alone. Docs and the architecture ledger are updated to say .exe only. No local validation, rebase, push, or PR mutation was performed. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1223ff2c-11b6-48d9-937b-a56408e99b93 * fix(exec-approvals): restore the full pre-binding catalog for D6 quarantine D6 asks a purely historical question about an allowlist entry that is already on disk and carries neither provenance nor an argument binding: would this exact entry have been refused durable approval when it was written? The answer has to come from the catalog as it actually stood immediately before argument binding replaced it, not from a fresh judgement about which programs look dangerous today. The previous revision restored that catalog from cdcb74f, which predates the indirect-host expansion, so it silently dropped 28 names: mshta, regsvr32, rundll32, msbuild, csc, vbc, dnx, rcsi, installutil, regasm, regsvcs, mavinject, msiexec, certutil, bitsadmin, wmic, forfiles, scriptrunner, pcalua, cmstp, odbcconf, msdt, ieexec, presentationhost, winrs, hh, msxsl and xwizard. Every one of those was refused durable approval in the shipped release, so a provenance-less entry naming one could only have been written under a model that denied it. Leaving them out would have converted a denial into an unconditional allow on upgrade, which is exactly the regression D6 exists to prevent. The catalog and IsVersionedInterpreter are now a verbatim copy of e4ff61e, the last revision before binding replaced them (69 names, byte-identical and in the same order). The accompanying comment states that this list must not be curated, pruned or extended, because anything added would claim to have been denied in a past release when it was not. This does not reopen D4. The catalog is not the security boundary and cannot become one: IsLegacyQuarantinedHost has exactly one call site (ExecAllowlistMatcher.MatchInternal), reached only when an entry has no ArgPattern and no Source. Every rule this node generates carries an argument binding, so new rules never take that path. WindowsCodeHost_BindsOnlyToThe ApprovedPayload still binds mshta, regsvr32 and rundll32 durably through argument binding, unchanged. Tests: - LegacyPathOnlyEntryForACommandHost_IsInert gains mshta, rundll32, regsvr32, msbuild, certutil and wmic. - LegacyQuarantineCoversTheFullPreBindingCatalog enumerates all 69 names and reports any that were dropped by name, so this class of truncation fails loudly rather than silently widening an allow. - LegacyQuarantineCoversVersionedInterpreters covers python3, python3.12, pythonw3.11 and pypy3.10. - LegacyQuarantineDoesNotCoverLookalikeNames pins that pythonish, python-wrapper and pypycache stay ordinary executables. - LegacyPathOnlyEntryForAnOrdinaryExecutable_StillMatches is the unchanged control for hostname.exe, git.exe and rg.exe. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1223ff2c-11b6-48d9-937b-a56408e99b93 * fix(exec-approvals): keep NormalizedBasename .exe-only and drop the .com quarantine claim Exact archaeology: e4ff61e's NormalizedBasename stripped `.exe` and nothing else. A `.com` spelling therefore never normalized to a catalog name, was never classified as a command host, and was never refused durable approval. The previous revision of this branch taught NormalizedBasename to strip `.com` as well so that a provenance-less entry naming `powershell.com` would go inert. That inverted the very rule D6 exists to enforce: it invents a denial that never happened, which is the same class of error as dropping one that did. It was also far wider than intended. NormalizedBasename is shared by IsEnv, the shell-wrapper normalizer, and the PowerShell and builtin classifiers, so the extra strip silently changed what all of them recognize, well outside the transitional quarantine it was meant to serve. A separate `.com` stripper for the quarantine alone would have been no better, because the historical behavior it must reproduce had no such concept at all. NormalizedBasename is now byte-identical to e4ff61e (verified mechanically), and a legacy entry naming `python.com` keeps working exactly as it did before. Unchanged and re-verified: - IsBindableExecutable is still `.exe` only, so a real Windows `.com` image is still refused durable binding. Bindability and legacy classification are independent questions and stay that way. - The pre-binding catalog is still the complete verbatim 69-name copy from e4ff61e, with the exact versioned-interpreter logic. - PinnedCarrierMatchesRequest still verifies by reconstruction, so interior spacing drift is still rejected. Tests: - ComExtension_QuarantinesAsTheSameCommandHostAsExe becomes ComExtension_IsNotLegacyQuarantined, asserting the opposite for the same three tokens. - LegacyPathOnlyEntryForACommandHostWithComExtension_IsInert becomes ..._StillMatches. - NativeComExtensionTarget_DoesNotBind is untouched: it is the bindability contract and is unaffected by classification. Docs: the WINDOWS_NODE_ARCHITECTURE quarantine section drops the `.com` spelling claim, names the indirect execution hosts now in the catalog, and states the `.exe`-only matching rule with its rationale. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1223ff2c-11b6-48d9-937b-a56408e99b93 * docs: drop the .com discussion from the legacy quarantine section The quarantine section explained at length why a `.com` spelling is not quarantined. The explanation was correct but it kept `.com` in front of the reader in a section about which names were historically refused, which is exactly the confusion to avoid. The rule is stated positively instead: the quarantine compares a basename with only a `.exe` suffix stripped, exactly as the original catalog did. Versioned interpreters (`python3.12`) and the indirect execution hosts are retained in the refused-outright list, since those were genuinely in the historical catalog. No behavior change. The `.com` reference remaining in this document is the pre-existing non-executable extension list, which is about resolution rather than quarantine. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1223ff2c-11b6-48d9-937b-a56408e99b93 * refactor: delete the superseded working-directory ambiguity helper ExecCommandResolver.HasCurrentDirectoryCandidate had zero callers once a trusted carrier's payload executable token became pinned to its resolved absolute path. Keeping it compiled "as a diagnostic" was the wrong disposition for a routine that used to be an authorization boundary: a dead security check is an invitation to wire it back up, and its own doc comment had to argue against that. Deleting it removes the invitation. The check was never sound as a boundary. It could only observe the working directory as it stood when approval was granted, and anything able to write there before launch simply wins after the check has passed. Pinning closes the window properly: cmd performs no second resolution, so there is nothing left to shadow. TryGetProcessCurrentDirectory went with it; it had no other caller. A comment in its place records what was removed and why, so the next reader does not rediscover the idea and reintroduce it. Docs: - ARCHITECTURE ledger row `exec-carrier-cwd-ambiguity-check` no longer carries the helper as still-allowed, and its closure note is discharged. The invariant now states that ExecCommandResolver exposes no such method, so the ledger asserts the absence rather than tolerating the presence. - WINDOWS_NODE_ARCHITECTURE no longer says the check is retained as a diagnostic. No new test: no existing test referenced the helper, so there is no contract to preserve or update. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1223ff2c-11b6-48d9-937b-a56408e99b93 * test: make carrier binding tests independent of the developer's PATH Fourteen carrier tests failed on a machine with coreutils installed, and the binder was right every time. These tests bind a bare `hostname.exe` payload, which resolves through PATH. The assumption was that PATH yields `C:\Windows\System32\hostname.exe`. With coreutils installed it yields `C:\Program Files\coreutils\bin\hostname.exe` instead, and that path contains a space. Under `cmd /s` the first and last quote of the payload are stripped and the rest is used verbatim, so a spaced path cannot be pinned without changing what cmd executes. The binder refuses and returns CarrierPayloadNotPinnable, which is the accepted D7 fail-closed behavior. The tests were asserting on ambient machine state, not on the code. Confirmed by probe against the real binder: Resolve(hostname.exe).ResolvedPath: [C:\Program Files\coreutils\bin\hostname.exe] TryBuildPinnedCarrier: False TryBind -> bound=<null> failure=CarrierPayloadNotPinnable Two fixes, chosen by what each layer can express: Binder-level tests pin PATH to the system directory through the existing `env` argument, so a bare name still has to be resolved through PATH and the behavior under test is unchanged. New ExecTestPath helper holds that, with the reasoning, so the next person does not reintroduce a process-PATH dependency. BareCmdResolvingOutsideSystemDirectory_ExecutesTheSystemImage keeps its rogue directory first but now also has the system directory on PATH, since otherwise the payload cannot resolve at all and the test fails before reaching its claim. Coordinator-level tests cannot do that. ExecApprovalV2InputValidator denies a non-empty env with custom-env-not-supported, so a request cannot carry a PATH and resolution always uses the process PATH. Those three tests name the payload absolutely instead. They are about the coordinator's authorize-and-execute wiring, which an absolute payload exercises identically, and bare-name resolution stays covered at the binder level where env can be injected. This also means the spaced-path refusal now has real-world evidence rather than only a synthetic test: an ordinary developer machine produced exactly the case D7 fails closed on. Validation on this commit: Shared 3618 total, 3586 passed, 0 failed, 32 skipped Tray 2165 total, 2165 passed, 0 failed WinNode 126 total, 126 passed, 0 failed Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1223ff2c-11b6-48d9-937b-a56408e99b93 * fix(exec-approvals): close two adversarial-review gaps in carrier pinning and currency Adversarial review of the exec-approval binding work surfaced two real defects that focused tests now cover. 1. Versioned executables could bind and then hard-fail at execution. PinnedCarrierMatchesRequest required the request name to have no extension before allowing the pinned name to carry one. But Path.HasExtension("python3.11") is true (it sees ".11"), so a versioned tool bound successfully at authorization time and then failed at execution time with InternalError(unresolved-executable-on-allow). The rule is now simply: the pinned name equals the request name, or the request name plus exactly one appended extension. Stem identity is still required, so a pinned name with a different stem is rejected. 2. The mid-approval policy guard could miss a tightened grant. ExecApprovalsCurrency fingerprinted allowlist entries by Pattern only, so adding an argPattern, narrowing an existing argPattern, or marking a path-only entry as generated was invisible to IsStillCurrent. The fingerprint is now the (Pattern, ArgPattern, Source) triple. Pattern keeps case-insensitive comparison for Windows paths while ArgPattern and Source compare ordinally, using a comparer rather than case folding so the ToUpperInvariant/ToLowerInvariant round-trip pitfall cannot collapse distinct identities. Neither change relaxes an authorization decision: both make a previously silent acceptance fail closed or bind correctly. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1223ff2c-11b6-48d9-937b-a56408e99b93 * fix(exec-approvals): fail closed on any provenance marker; make MXC proof hermetic Second adversarial reviewer findings. Accepted: source gating in ExecAllowlistMatcher was fail-open. A path-only entry was treated as generated (and therefore inert) only when its source was exactly "allow-always" under an ordinal comparison. Any other non-empty value - a different case, a padded string, a marker written by another producer, or a corrupted one - fell through to the path-only branch. That was fail-open twice over: the entry gained path-only reach, and because its source was non-empty it also skipped the legacy quarantine check. The rule is now simply that any non-empty source means a generator produced the entry, so a generated entry that lost its argPattern is inert regardless of spelling. Provenance is absent only when source is empty or whitespace, and those entries keep hand-written path-only semantics behind the quarantine check exactly as before. No entry that used to be denied becomes allowed. Rejected: persisted command text as a secret-disclosure regression. The reviewer proposed redacting CommandText/LastUsedCommand and filtering them out of system.execApprovals.get. That does not mitigate the stated risk and would break two contracts. ArgPattern already encodes the exact argv and is load-bearing for authorization, so arguments are on disk either way; redaction would only stop an operator from auditing what they approved. The get payload is returned verbatim and its hash is the concurrency token for a matching set, so filtering the bytes would break read-modify-write. Returning the file from execApprovals.get also predates this branch. The invariant is recorded on the contract instead. Also makes the MXC exec-approval proof hermetic. It used hostname.exe, which is commonly shadowed on a developer PATH by a copy in a directory the sandbox does not grant, so the proof could fail for reasons that have nothing to do with approvals. It now uses whoami.exe, which has no common shadow. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1223ff2c-11b6-48d9-937b-a56408e99b93 * test(mxc-e2e): recognize the second host child-spawn incapacity signature The MXC exec-approval proofs already tolerated one shape of "this host cannot spawn a child executable inside the AppContainer": exit code 0xC0000142, STATUS_DLL_INIT_FAILED. The same incapacity also appears as CreateProcess being refused outright, which cmd reports as exit code 1 with "Access is denied." on stderr. On a host expressing the second shape the proofs failed as if approvals were broken, which is the wrong report. The evidence that this is a host property and not an approvals or binding problem is the child-spawn diagnostic, which runs with grant=none. No allowlist entry participates, nothing is bound, and the carrier executes exactly as the gateway sent it, with a bare executable name and no pinned path. It still fails, while the echo builtin in the same payload and the same container succeeds. It also reproduces under security=full. So it is not caused by argument binding, by pinning a payload to a resolved absolute path, or by any V2 decision. The tolerance is deliberately narrow: exit code 1 together with exactly that stderr message. It does not weaken what these tests prove. Each caller separately asserts the approval decision and the MXC request shape from the tray log, and a real approvals regression surfaces as decision=deny or a node error rather than this signature. Any other nonzero exit code still fails. Documents the limitation and its validation consequences in the gateway node exec FAQ. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1223ff2c-11b6-48d9-937b-a56408e99b93 * test(mxc-e2e): report an incomplete child-spawn probe as host capability, not failure On a host that cannot spawn a child executable inside the MXC AppContainer, the sandbox run does not always come back with a clean nonzero exit. Observed here: wxc-exec starts the container, the node logs decision=allow, and the run then never returns a result at all, so the gateway CLI call gives up and the probe fails before it can read any payload. That surfaced as an approvals proof failing at AssertCommandSucceeded, which blames exec approvals for a sandbox-runtime limitation of the host. The child-spawn diagnostic now reports an incomplete probe as what it is: host capability could not be established. This test asserts no approvals behavior, so nothing is being swallowed. The approval decision and the MXC request shape are asserted by the two bound-rule proofs, which still fail normally, and every other nonzero exit code is still a failure everywhere else. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1223ff2c-11b6-48d9-937b-a56408e99b93 * fix: pin the canonical cmd carrier for one-time allows too Adversarial review found that the two launch-time pins were applied only when execution went through the reusable transport, which was selected for durable allows and match-dependent fallback allows but not for a one-time Allow Once. An Allow Once therefore executed the request's own argv: argv[0] was the request's PATH-resolved cmd.exe, and a bare payload name stayed bare for cmd to resolve again at launch, searching the working directory before PATH. The prompt meanwhile names the inner executable the binder resolved through a trusted system cmd.exe, so the operator approved one image while a different one could run. With a writable directory ahead of the system directory on the node's PATH, approving a command once could execute attacker-controlled code. Approval identity, durability, and execution transport are three separate things. Route a recognized canonical carrier through its pinned transport whenever one exists, independent of durability. Durability is still gated on requiresReusableExecution, so a one-time allow persists nothing. Regression test asserts the pinned payload token; it fails without this change with the token still bare. The test discovers a bindable payload from a candidate list because a coordinator request cannot carry a custom env and a shadowed system name can resolve under a spaced path. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1223ff2c-11b6-48d9-937b-a56408e99b93 * fix: pin execution transport on every approved exec path Follow-up to ce0a3cb from the same adversarial review, which found two more paths that still executed an image other than the one the operator approved. 1. The pre-approved branch chose the reusable transport only for an allowlist hit, so a security=full/ask=off run reached process launch with the carrier unpinned: argv[0] resolved through PATH and a bare payload token stayed bare for cmd to resolve again at launch. Full policy already permits arbitrary execution, so this is not an authorization escalation, but it left the "every approved run is pinned" invariant untrue and the two allow branches inconsistent. 2. A direct command is resolved twice, once by the normalizer for the execution identity and once by the binder for the identity that is displayed and stored. Execution used the normalizer's, so the prompt could name one image while a separate lookup of the same name selected another. Both collapse into one rule, so transport selection now lives in a single helper used by both decision points: whenever the binder produced a reusable command, that command's argv is what runs. This is safe for direct commands because BindDirect already applies the same env-wrapper unwrapping and modifier rejection as BuildApprovedExecution and adds strictly more gates, so only the source of the resolved executable changes. Durability is unchanged and still gated separately, so no allow persists anything it did not persist before. PreApprovedFullPolicy_CanonicalCarrier_ExecutesThePinnedCarrier fails without this change with the payload token still bare. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1223ff2c-11b6-48d9-937b-a56408e99b93 --------- Co-authored-by: Copilot App <[email protected]> Co-authored-by: Scott Hanselman <[email protected]> Copilot-Session: 1223ff2c-11b6-48d9-937b-a56408e99b93
1 parent 01faa64 commit c9608c8

40 files changed

Lines changed: 5359 additions & 205 deletions

‎docs/ARCHITECTURE.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,13 @@ leading and trailing pipe. Columns, in order:
144144
| functional-chat-default-mount | closed | src/OpenClaw.Tray.WinUI/Chat/FunctionalChatHostExtensions.cs | mounting the FunctionalUI chat tree as the default ChatPage or ChatWindow surface | ReactorChatHostExtensions and OpenClawReactorChatRoot | legacy FunctionalUI chat files may remain for focused compatibility coverage only | ChatPage and ChatWindow mount the Reactor root directly into their existing ChatHost Borders; no FunctionalUI component mounts or nests Reactor on the default path | review-only: user explicitly deferred new tests for this migration; required build and existing shared/tray suites still run | review-only | when legacy FunctionalUI chat surfaces are removed |
145145
| settings-store | authoritative | src/OpenClaw.Tray.WinUI/Pages/SettingsPage.xaml.cs | hand-rolled save/echo suppression flags for two-way settings binding | ISettingsStore | PermissionsPage and other surfaces may read SettingsManager directly until migrated | a save originating from Update does not echo Changed to the caller and external saves are republished on the UI thread | SettingsStoreTests.Update_DoesNotEchoChangedToSelf | behavioral | when all settings surfaces read and write through ISettingsStore |
146146
| settings-page-vm | authoritative | src/OpenClaw.Tray.WinUI/Pages/SettingsPage.xaml.cs | settings load, persist, echo-guard, and auto-save wiring | SettingsPageViewModel | code-behind keeps gateway-uninstall, gateway-info and uptime timer, saved-indicator visual, and app-info population | each settings control persists its field through the store preserving mutate-save-notify order and does not re-persist on external change | SettingsPageViewModelTests.ExternalChange_ReloadsWithoutRePersisting | behavioral | when the Settings page holds no settings persistence logic in code-behind |
147+
| exec-reusable-binding | authoritative | src/OpenClaw.Shared/ExecApprovals/ExecCommandResolution.cs | deriving durable allowlist identities and Allow Always patterns from multi-segment shell resolution | ExecReusableCommandBinder | ExecCommandResolver.Resolve stays the singular resolution used by the state machine and prompt display | at most one identity may be durably authorized per request and it is a fully qualified existing `.exe` image whose arguments are pinned by the generated rule | ExecReusableCommandBinderTests.MultiElementCarrierTail_Binds | behavioral | - |
148+
| exec-multi-segment-allowlist-closed | closed | src/OpenClaw.Shared/ExecApprovals/ExecCommandResolution.cs | ResolveForAllowlist and ResolveAllowAlwaysPatterns feeding allowlist matching or Allow Always patterns | ExecReusableCommandBinder | the two methods remain compiled with their historical tests until removed but have no production callers | the approval pipeline derives AllowlistResolutions and AllowAlwaysPatterns only from ExecReusableCommandBinder.TryBind | ExecApprovalV2NormalizationPipelineOwnershipTests.Normalizer_DerivesDurableIdentity_OnlyFromReusableBinder | source-shape | when ResolveForAllowlist and ResolveAllowAlwaysPatterns are deleted |
149+
| canonical-cmd-carrier | authoritative | src/OpenClaw.Shared/Mxc/MxcConfigBuilder.cs | recognizing the cmd.exe /d /s /c carrier and extracting its command payload | CanonicalCmdCarrier | MxcConfigBuilder keeps cmd command-mode switch detection and command-line construction | the approvals binder and the MXC command-line builder agree on which argv shapes are the canonical cmd carrier and what payload they carry | CanonicalCmdCarrierTests.BinderAndMxcBuilder_AgreeOnCarrierRecognition | behavioral | - |
150+
| exec-carrier-transport-identity | authoritative | src/OpenClaw.Shared/ExecApprovals/ExecApprovalsCoordinator.cs | deciding what a trusted canonical cmd carrier executes once its inner payload is durably authorized | ExecReusableCommandBinder builds the execution argv; CanonicalCmdCarrier.PinnedCarrierMatchesRequest enforces it | the coordinator still owns prompt, policy, and persistence decisions | a durably approved carrier executes a reconstruction of the validated carrier so the MXC in-band PATH/TEMP bootstrap survives; exactly two tokens may differ from the request, argv[0] pinned to the resolved System32 or SysWOW64 cmd.exe and the payload executable token pinned to its resolved absolute path, with every other token and all interior spacing ordinal-identical so no metacharacter drift can be introduced | ExecReusableCommandBinderTests.TrustedCarrier_KeepsTransportSeparateFromIdentity | behavioral | when MXC accepts an explicit environment and the bound direct argv can be executed instead |
151+
| cmd-payload-tokenization | authoritative | src/OpenClaw.Shared/ExecApprovals/ExecReusableCommandBinder.cs | parsing a cmd payload into tokens and rewriting its executable token | CmdPayloadTokenizer | ExecReusableCommandBinder.TryTokenizeStaticCmdPayload remains as a delegating wrapper for existing callers and tests | a payload rewrite is built from parsed token spans and is accepted only after re-parsing proves the argument list is unchanged except for the pinned executable | ExecReusableCommandBinderTests.PinnedCarrier_DoesNotRewriteArgumentsThatRepeatTheExecutableText | behavioral | - |
152+
| exec-carrier-cwd-ambiguity-check | closed | src/OpenClaw.Shared/ExecApprovals/ExecReusableCommandBinder.cs | deciding whether a carrier payload may be durably approved when the working directory could shadow it | CanonicalCmdCarrier.TryBuildPinnedCarrier (payload executable pinning) | - | the approval-time working-directory check is deleted, not merely bypassed: ExecCommandResolver exposes no HasCurrentDirectoryCandidate, a trusted carrier's payload executable is pinned to its resolved absolute path so cmd has nothing to search for, and a post-approval shadow cannot win | ExecReusableCommandBinderTests.PinnedCarrier_IgnoresShadowInsertedAfterApproval | behavioral | - |
153+
| exec-legacy-host-quarantine | authoritative | src/OpenClaw.Shared/ExecApprovals/ExecCommandToken.cs | deciding whether a provenance-less path-only allowlist entry authorizes an interpreter or code host | ExecAllowlistMatcher.MatchInternal via ExecCommandToken.IsLegacyQuarantinedHost | argument binding remains the security boundary for every rule this node generates | an allowlist entry with no source and no argPattern is inert when its resolved target is a command host the previous model refused, is never deleted or migrated, and is superseded only by an explicit allow-always sibling carrying source and argPattern | ExecAllowlistArgBindingTests.LegacyPathOnlyEntryForACommandHost_IsInert | behavioral | - |
147154
<!-- LEDGER:END -->
148155

149156
## Deferred test builders

‎docs/OPENCLAW_GATEWAY_NODE_EXEC_FAQ.md‎

Lines changed: 88 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,31 @@ This preserves the authority split:
154154
Windows compare-and-swap and monotonicity checks are in
155155
[`SystemCapability.cs`](https://github.com/openclaw/openclaw-windows-node/blob/d7d153ca5d409487e06ef584b1de1184520e90e6/src/OpenClaw.Shared/Capabilities/SystemCapability.cs#L449-L698).
156156

157+
`baseHash` travels in one direction only, and the upstream schema enforces that.
158+
In
159+
[`exec-approvals.ts`](https://github.com/openclaw/openclaw/blob/db90dff1396fecbf7029e9e9ea19d6c6ca3e644e/packages/gateway-protocol/src/schema/exec-approvals.ts#L104-L165),
160+
`ExecApprovalsNodeSnapshotSchema` sets `additionalProperties: false` at line 119
161+
and its no-file branch lists `{ required: ["baseHash"] }` at line 126 inside a
162+
`not.anyOf` guard:
163+
164+
```ts
165+
additionalProperties: false,
166+
oneOf: [
167+
{
168+
required: ["path", "exists", "hash", "file"],
169+
not: {
170+
anyOf: [
171+
{ required: ["enabled"] },
172+
{ required: ["baseHash"] },
173+
```
174+
175+
A `get` response carrying `path`, `exists`, `hash`, `file`, and `baseHash`
176+
therefore matches no branch of the `oneOf` and is rejected by the gateway. The
177+
node must omit `baseHash` from the snapshot it returns. A client reads `hash`
178+
from that snapshot and passes it back as `baseHash` on the next `set`, which is
179+
how the compare-and-swap closes. Omitting it from the response is required for
180+
protocol conformance, not merely tidier.
181+
157182
## What happens when a user says "delete this"?
158183
159184
There is no universal "delete subsystem." The gateway agent first resolves what
@@ -224,12 +249,26 @@ gateway can build:
224249
225250
The gateway evaluates its `host=node` policy, dispatches `system.run`, and
226251
Windows separately evaluates the exact wrapper and payload under V2 before MXC
227-
or host execution. Windows resolves `argv[0]` to `cmd.exe`, so the approved
228-
executable is the command host itself. The inner `del` payload is considered
229-
for allowlist matching, but a shell built-in cannot resolve as a standalone
230-
executable. **Allow once** can run the command; **Allow always** is rejected
231-
with `persistent-approval-not-permitted-for-command-host` rather than creating
232-
a durable grant for general `cmd.exe` execution.
252+
or host execution. Windows recognizes the strict canonical `cmd.exe /d /s /c`
253+
carrier and looks through it to the payload, so the durable approval identity is
254+
the payload's resolved executable plus an exact argument pattern, not the command
255+
host. The carrier itself is never the approved identity.
256+
257+
In this specific example the payload is `del`, a `cmd` built-in with no standalone
258+
executable to resolve, so nothing is bindable: **Allow once** can run the command
259+
and **Allow always** is still rejected with
260+
`persistent-approval-not-permitted-for-command-host`. A payload that does resolve
261+
to a real `.exe` behaves differently. For
262+
`["cmd.exe","/d","/s","/c","hostname.exe"]`, **Allow always** is permitted and
263+
records `C:\Windows\System32\hostname.exe` with an argument pattern that matches
264+
only that exact argument list. It does not create a durable grant for general
265+
`cmd.exe` execution.
266+
267+
Binding is refused, leaving the request prompt-only, when the payload executable
268+
is not a plain `.exe`, when the payload cannot be tokenized unambiguously, when
269+
the resolved path contains a space or other character that `cmd /s` would not
270+
preserve verbatim, or when the carrier is not the strict canonical form. Fail
271+
closed is the intended outcome in each of those cases.
233272
234273
## How does agent `exec` become node `system.run`?
235274
@@ -465,7 +504,7 @@ boundary.
465504
| --- | --- | --- |
466505
| Input identity | Shell command text | Canonical argv plus resolved executable identity |
467506
| Typical rule | Command-text glob | Executable/argument-aware allowlist entries |
468-
| Shell ambiguity | Rule could accidentally authorize a reusable command host such as `cmd.exe` or PowerShell | Shell wrappers are normalized and indirect command hosts cannot receive unsafe persistent approval |
507+
| Shell ambiguity | Rule could accidentally authorize a reusable command host such as `cmd.exe` or PowerShell | Shell wrappers are structurally classified and bound to an exact argument pattern, so an indirect command host cannot receive unsafe persistent approval |
469508
| Prompt result | Legacy behavior | Explicit allow-once or allow-always, with deny |
470509
| Race handling | Limited | Policy snapshot and execution-boundary revalidation |
471510
| Execution | Could reparse shell text | Approved absolute executable and argv are passed to the runner |
@@ -476,6 +515,21 @@ mechanically converted. Conversion could widen a narrow-looking text rule into
476515
a grant for a general command interpreter. Existing V1 approvals therefore
477516
require a new attended decision under V2.
478517
518+
The mechanism behind the "shell ambiguity" row is structural, not a maintained
519+
list of dangerous program names. A resolved executable is classified by shape as
520+
a shell wrapper, interpreter, or code host, and every durable entry written by
521+
V2 carries an argument pattern that must match the exact argument list. A name
522+
catalog is not the security boundary, because renaming a binary would defeat it.
523+
524+
One narrow legacy case remains. An allowlist entry written before argument
525+
binding existed has neither a recorded source nor an argument pattern. Such an
526+
entry stays valid for an ordinary executable, but it is inert when its resolved
527+
executable is one of the interpreters or indirect command hosts that were
528+
already refused durable approval at the time the entry could have been written.
529+
Those requests prompt instead of matching. The entry is not deleted and is not
530+
silently upgraded; only an explicit **Allow always** creates a new
531+
argument-bound entry that can match.
532+
479533
Do not confuse the pipeline name with the persisted schema field.
480534
`exec-approvals.json` currently contains `"version": 1`; that is the file
481535
format version used by the V2 pipeline. Also, the store's "legacy migration"
@@ -563,6 +617,32 @@ Upstream also has separate sandbox and plugin concepts:
563617
Those extension points do not make MXC a gateway plugin. They are separate
564618
layers with different owners.
565619
620+
### Host limitation: some hosts cannot spawn a child executable under MXC
621+
622+
On some Windows hosts the AppContainer starts and runs `cmd` builtins, but the
623+
first child executable it tries to launch never runs. Two signatures have been
624+
observed for the same underlying incapacity:
625+
626+
- the child dies during DLL initialization, reported as exit code `0xC0000142`
627+
(`STATUS_DLL_INIT_FAILED`);
628+
- `CreateProcess` is refused outright, reported as exit code `1` with
629+
`Access is denied.` on stderr.
630+
631+
This is a sandbox-runtime property of the host. It is independent of exec
632+
approvals: it reproduces with `security=full`, with no allowlist entry
633+
involved, and with the command executed exactly as the gateway sent it, so it
634+
is not caused by argument binding, by pinning a payload to a resolved absolute
635+
path, or by any V2 decision. A `cmd` builtin such as `echo` still succeeds in
636+
the same container, which is what isolates the failure to process creation.
637+
638+
Consequences for validation on such a host: approval decisions are still
639+
provable end to end through a real gateway, because the decision is asserted
640+
from the node's own log and from the MXC request shape. Whether the approved
641+
command then produces output is not provable there. The MXC E2E records this
642+
explicitly rather than passing quietly, and it never tolerates any other
643+
nonzero exit code. See `Diagnostic_SystemRun_SpawnsChildExecutableInSandbox`
644+
and `AssertApprovedCommandRan` in `tests/OpenClaw.E2ETests/Setup/MxcSetupAndConnectTests.cs`.
645+
566646
By default, Windows enables sandboxing but preserves a compatibility host
567647
fallback if MXC is unavailable. Enabling **block host fallback when MXC is
568648
unavailable** changes that case to a deny. The actual result reports whether
@@ -695,7 +775,7 @@ Any layer can deny. A later layer cannot widen an earlier deny.
695775
| Exec host routing | n/a, Windows is the target host | `bash-tools.exec-run.ts`, `bash-tools.exec-host-gateway.ts`, `bash-tools.exec-host-node.ts` |
696776
| Shell argv construction | `LocalCommandRunner` for its legacy shell path; V2 approved runs are direct argv | `src/infra/node-shell.ts` |
697777
| Gateway node invoke gates | node receives only the post-gate request | `src/gateway/server-methods/nodes.invoke.ts` |
698-
| Windows local approval | `ExecApprovalsCoordinator`, `ExecApprovalsStore` | comparable node-host exec approval contracts |
778+
| Windows local approval | `ExecApprovalsCoordinator`, `ExecApprovalsStore`, `ExecReusableCommandBinder`, `CanonicalCmdCarrier`, `CmdPayloadTokenizer` | comparable node-host exec approval contracts |
699779
| Windows sandbox | `MxcCommandRunner`, `MxcPolicyBuilder`, `DirectAppContainerExecutor` | separate agent sandbox backend interfaces |
700780
| Protocol version | connect payloads | `packages/gateway-protocol/src/version.ts` |
701781
| Managed gateway release | `GatewayLkgVersion.cs`, setup engine | OpenClaw tag `v2026.6.11` |

0 commit comments

Comments
 (0)