Skip to content

SDK should avoid passing the full sandbox config envelope through process argv #626

Closed

Description

Draft upstream MXC bug

Proposed title

SDK should avoid passing the full sandbox config envelope through process argv

Relevant area(s)

Windows

Brief description of your issue

@microsoft/mxc-sdk currently serializes the full sandbox request envelope and passes it to wxc-exec as a base64 command-line argument (--config-base64 <payload>). That makes the full config available through normal process command-line inspection while the child process is starting/running.

For SDK callers that generate configs from higher-level products, the envelope can include sensitive operational details such as command lines, filesystem paths, environment-derived values, policy details, or future config fields. Base64 does not provide confidentiality, so the SDK default transport should avoid putting the full envelope in argv.

Steps to reproduce

  1. Use @microsoft/[email protected] on Windows with the default WXC executable path resolution.

  2. Build any one-shot sandbox config and call the SDK path that resolves the executable and arguments, for example the exported spawn/resolve flow that reaches resolveBinaryAndCommonArgs.

  3. Observe that the SDK builds the child process arguments as:

    --config-base64 <base64-encoded JSON envelope>
    
  4. Decode the second argument and confirm it is the full JSON request envelope.

  5. Start the process and inspect the command line using common process-inspection tools while wxc-exec is running.

Source evidence checked:

  • Current upstream main commit 25e504e08f297b52c8aa2ca4966560a6ebb8b48f
    • sdk/src/helper.ts:190-192 creates envelopeBase64 from envelopeJson and pushes --config-base64.
    • src/core/wxc/src/main.rs:51-56 declares the --config-base64 CLI option.
    • src/core/wxc/src/main.rs:697-701 reads the base64 argument as the selected config input.
    • src/core/wxc/src/main.rs:745 passes that input to load_mxc_request_with_options.
  • Published package @microsoft/[email protected]
    • dist/helper.js:151-152 has the same default Buffer.from(...).toString('base64') plus args.push('--config-base64', envelopeBase64) behavior.

I searched existing open and closed issues for config-base64, config base64, argv, command line, and process list config. The only config-base64 hit I found was #561, which is about panic telemetry and is not the same transport issue.

Expected behavior

The SDK default process transport should avoid putting the full config envelope in argv. For example, it could use a temporary config file with restrictive permissions, stdin, a named pipe, or another transport that does not expose the full payload through process command-line inspection.

It may still be useful for wxc-exec to keep --config-base64 for explicit/manual/debug/test use, but SDK callers should have a safer default and/or a clear option to choose a non-argv transport.

Actual behavior

The SDK default path always passes the full JSON envelope as a base64 command-line argument to wxc-exec. wxc-exec treats --config-base64 as a first-class config input and decodes it internally.

Impact

Consumers embedding MXC in larger tools may accidentally expose policy/config contents to process command-line observers. This is especially awkward for sandbox integrations because the request envelope is the same object that describes the command, filesystem policy, environment-related settings, and containment options.

This report is about the default transport shape and data minimization.

Activity

  1. added
    Needs-Triage
    OS-Windows
    on Jul 9, 2026
  2. added
    Area-Schema
    on Jul 13, 2026
  3. github-actions commented on Jul 13, 2026

    @github-actions

    Triage complete.

    Labels applied: Area-SDK-Api, Area-Executor-Schema (in addition to the existing OS-Windows)

    Assigned: @huzaifa-d — this issue spans the SDK API transport layer (sdk/src/helper.ts argv construction) and the executor's CLI schema (wxc-exec --config-base64 argument handling).

    Needs-Triage has been removed.

    Generated by 🏷️ Issue Triage for #626 · 23.5 AIC · ⌖ 8.03 AIC · ⊞ 6.3K · ◷

  4. removed
    Needs-Triage
    on Jul 13, 2026
  5. huzaifa-d commented on Jul 20, 2026

    @huzaifa-d
    Contributor

    I agree that putting the full config in argv is not ideal, but I do not think this is a significant security issue for MXC. The config is already supplied by the caller, and an attacker who can inspect the SDK process command line is already running with access to the same user context. This does not provide a sandbox escape or privilege escalation.

    Avoiding argv would require adding and maintaining a new transport, such as a protected temporary file, named pipe, or inherited Windows handle. IMO not worth given the small blast radius.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Area-SchemaOS-Windows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions