You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document how cmd.exe interprets wxc-exec arguments after -- - #1926
wxc-exec.exe turns the arguments after -- into a single command line. On IsolationSession and Windows Sandbox, that command line runs through cmd.exe /c. Quoting doesn't stop cmd from expanding %VAR%, and stray quotes can make &, | and similar characters act as shell syntax. None of this was documented, and the cmdline.rs Rustdoc said the quoting kept arguments from being read as shell syntax.
This PR adds a "wxc-exec Command Arguments" section to docs/schema.md. It explains how arguments are quoted on each backend, what cmd still interprets, and why escaping values for cmd first doesn't work. It tells callers to check values they don't control, such as user-supplied file names, against a strict allowlist. The Windows Sandbox guide and the container lifecycle doc link to the new section, and the cmdline.rs Rustdoc now describes what the quoting actually does.
No behavior changes. W365Agents isn't affected because it launches the command line without cmd.exe.
cargo fmt --all -- --check and cargo doc -p mxc-sdk --no-deps -q (from src/): passed, no warnings.
Ran each described case through cmd /c on Windows to confirm it, including an embedded \" exposing & in a later argument, quote removal exposing & in a middle argument, and a pre-escaped a^&b reaching the program unchanged.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The documentation gives incorrect backend-specific quoting guidance, understates command-wide operator exposure, and suggests escaping that is insufficient when arguments are quoted again.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The documentation omits W365Agents from the WindowsCommandProcessor quoting rules and fails to distinguish quoting from cmd.exe invocation.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Correct W365Agents quoting guidance for raw-shell payloads
docs/schema.md:415
W365Agents uses WindowsCommandProcessor too, so it quotes cmd operators even though its payload uses shell: "raw" and does not add cmd.exe. The current list gives its callers the wrong quoting rule; include W365Agents and distinguish quoting from shell invocation. The same distinction is missing in src/mxc-sdk/src/core/mxc_common/cmdline.rs:27–28.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Human assessment is needed to evaluate security-sensitive gaps in the quoting guidance for explicitly launched command processors and Hyperlight’s execution of guest-runtime source.
No open issues 🎉
Review effort: Max
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📖 Description
wxc-exec.exeturns the arguments after--into a single command line. On IsolationSession and Windows Sandbox, that command line runs throughcmd.exe /c. Quoting doesn't stopcmdfrom expanding%VAR%, and stray quotes can make&,|and similar characters act as shell syntax. None of this was documented, and thecmdline.rsRustdoc said the quoting kept arguments from being read as shell syntax.This PR adds a "
wxc-execCommand Arguments" section todocs/schema.md. It explains how arguments are quoted on each backend, whatcmdstill interprets, and why escaping values forcmdfirst doesn't work. It tells callers to check values they don't control, such as user-supplied file names, against a strict allowlist. The Windows Sandbox guide and the container lifecycle doc link to the new section, and thecmdline.rsRustdoc now describes what the quoting actually does.No behavior changes. W365Agents isn't affected because it launches the command line without
cmd.exe.🔗 References
src/mxc-sdk/src/core/mxc_common/cmdline.rs(CommandLineContext::for_backend,append_windows_cmd)src/mxc-sdk/src/backends/isolation_session/common/process_options.rs(/c {})src/mxc-sdk/src/bin/windows_sandbox_guest/executor.rs(cmd.exe /C+raw_arg)src/mxc-sdk/src/backends/w365agents/exec/payload.rs(shell: "raw")🔍 Validation
cargo fmt --all -- --checkandcargo doc -p mxc-sdk --no-deps -q(fromsrc/): passed, no warnings.cmd /con Windows to confirm it, including an embedded\"exposing&in a later argument, quote removal exposing&in a middle argument, and a pre-escapeda^&breaching the program unchanged.✅ Checklist
feature-acceptedCargo.lock, thedependency-feed-checkcheck passes (see pull request builds)📋 Issue Type