Skip to content

Reject embedded NULL in containerID - #1556

Draft
safmswork wants to merge 4 commits into
microsoft:mainfrom
safmswork:user/sahrbini/containerid-reject-nul
Draft

safmswork wants to merge 4 commits into
microsoft:mainfrom
safmswork:user/sahrbini/containerid-reject-nul

Conversation

@safmswork

@safmswork safmswork commented Oct 21, 2026 •

Copy link
Copy Markdown

📖 Description

🔗 References

🔍 Validation

✅ Checklist

📋 Issue Type

  • Bug fix
  • Feature
  • Task

GitHub Actions runs the PR validation build automatically. The ADO pipeline
(MXC-PR-Build) is the Azure version of the PR pipeline, kept in parity with the GitHub
Actions build; it runs on merge to main, and Microsoft reviewers with write access can trigger it
on a PR with /azp run. See pull request builds.

If the dependency-feed-check check fails on a new dependency, the crate must be added to
the feed before the PR can pass. See pull request builds
for the steps.

Microsoft Reviewers: Open in CodeFlow

Copilot AI balanced review requested due to automatic review settings October 21, 2026 21:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The security fix lacks the required CI-wired functional regression verifying rejection through the executor before workload execution or host permission changes.

1 open issue
What changed in this PR

This PR rejects embedded NUL characters in container identities to prevent truncating Windows string conversions from mapping distinct IDs to the same security identity.

Changes:

  • Rejects NUL-containing container IDs during request normalization and adds defensive Windows backend checks.
  • Adds parser and SID-derivation unit tests.
  • Documents the identity restriction and warns about truncation in to_wide.
File Description
src/​mxc-sdk/​src/​core/​mxc_common/​string_util.rs Documents truncation and security-identity risks.
src/​mxc-sdk/​src/​core/​mxc_common/​config_parser.rs Rejects embedded NUL IDs and adds parser tests.
src/​mxc-sdk/​src/​backends/​wslc/​common/​wsl_container_runner.rs Rejects embedded NUL IDs before session-name conversion.
src/​mxc-sdk/​src/​backends/​process_container/​common/​sandbox_tracking.rs Guards SID derivation against embedded NUL identities.
src/​mxc-sdk/​src/​backends/​process_container/​common/​appcontainer_runner.rs Guards AppContainer identity conversion and adds regression tests.
docs/​schema.md Explains the container ID restriction.

Review effort: Balanced

Comment thread src/mxc-sdk/src/core/mxc_common/config_parser.rs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The shared parser restriction changes published v1 SDK behavior on backends unaffected by Windows identity truncation.

2 open issues

Review effort: Balanced

Comment thread src/mxc-sdk/src/core/mxc_common/config_parser.rs
The scheduled area writes the six-character JSON escape and requires the executor to reject it before the workload runs. A normal id is the positive control.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b49d2002-1870-442a-b920-779f4ac7edd8
Copilot AI balanced review requested due to automatic review settings October 27, 2026 22:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The shared validation also changes accepted identifiers on unaffected backends, requiring maintainer confirmation of published SDK compatibility.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

Keep the rejection. Current main removed the AppContainer fallback and the old processcontainer suite, so the scheduled regression now lives in the contract tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b49d2002-1870-442a-b920-779f4ac7edd8
Copilot AI balanced review requested due to automatic review settings October 27, 2026 22:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

CI logs confirm that the new WSLc return expression fails the required formatting check.

1 open issue

Review effort: Balanced

Comment thread src/mxc-sdk/src/backends/wslc/common/wsl_container_runner.rs Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 28, 2026 02:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the change that rejects embedded NULs in container identifiers.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants