Repository navigation
Restrict PowerShell discovery to scoped filesystem grants - #1590
Merged
Merged
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Gudge (MGudgin)
force-pushed
the
user/gudge/fix-tool-discovery-root-read
branch
from
October 27, 2026 15:21
42e431d to
61f3e7a
Compare
Gudge (MGudgin)
force-pushed
the
user/gudge/fix-tool-discovery-root-read
branch
from
October 27, 2026 15:22
61f3e7a to
491ad6a
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The change breaks V1 Rust and Node SDK compatibility by removing system-drive root access needed by some PowerShell callers, so the restricted behavior should use new versioned APIs with migration guidance.
1 open issue
What changed in this PR
This PR narrows Windows tool-discovery permissions in the Rust and Node SDKs by removing the implicit drive-root read-only grant when pwsh.exe is found. The .NET SDK is unaffected.
Changes:
- Preserve PSReadLine history access without automatically granting drive-root reads.
- Update unit tests and add a required ProcessContainer regression test for tool access and sibling-file denial.
- Document the restricted permissions and potential PowerShell startup impact.
| File | Description |
|---|---|
src/mxc-sdk/src/policy.rs |
Removes the Rust root grant and updates regression coverage. |
src/mxc-sdk/README.md |
Explains discovery permissions and startup limitations. |
sdk/node/tests/unit/policy.test.ts |
Asserts discovery no longer adds drive-root access. |
sdk/node/tests/integration/windows-process-container.test.ts |
Tests tool reads and private sibling-file denial. |
sdk/node/src/v1/policy/filesystem.ts |
Removes the Node root grant while retaining history access. |
sdk/node/README.md |
Documents restricted discovery permissions. |
scripts/ci/run_backend_validation_tests.ps1 |
Requires the new filesystem regression test. |
docs/development/build-and-test/ci-validation-infrastructure.md |
Describes the regression scenario and required-test gate. |
docs/api-reference/rust/v1/api.md |
Updates Rust discovery behavior and limitations. |
docs/api-reference/node/v1/api.md |
Updates Node discovery behavior and limitations. |
Review effort: Balanced
Gudge (MGudgin)
force-pushed
the
user/gudge/fix-tool-discovery-root-read
branch
from
October 27, 2026 18:13
491ad6a to
64057fb
Compare
This PR prevents Rust and Node V1 tool discovery from implicitly granting recursive read access to the system-drive root when PowerShell is present. It preserves tool-directory and PSReadLine history access, keeps ProcessContainer errors actionable, and documents the security-servicing exception within V1. Details * Preserve real Win32 launch errors and nonzero workload results instead of recommending drive-root access. * Keep discovery fixtures under their crate or test directories so host temporary storage beneath the Windows directory does not filter them out. * Require tool-read/private-sibling-denial validation and an explicit discovered-path assertion in scheduled ProcessContainer tests. * Document the specific V1 exception and PowerShell startup guidance in the versioning policy, SDK READMEs, and API references. Tests * `cargo fmt --all -- --check` and `cargo clippy -p mxc-sdk --lib --tests -- -D warnings` passed. * `cargo test -p mxc-sdk --lib launch_diagnostics` passed (26 tests). The Rust discovery regression also passed (1 test). * Diagnostic and TEMP/WINDIR fixture regressions demonstrated failures before their fixes and passed afterward. * Node policy tests passed (10 tests); SDK `npm run build` and `npm run build:test-unit` passed. Co-authored-by: Gudge <gudge@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 76847b9f-ffd6-497e-95cb-e6d395704e3a Copilot-Session: 1ce18a71-9051-4c4d-9d5f-23155754276f Generated-with: gpt-6.1-sol
Gudge (MGudgin)
force-pushed
the
user/gudge/fix-tool-discovery-root-read
branch
from
October 27, 2026 18:15
64057fb to
1035128
Compare
Branden Bonaby (bbonaby)
requested changes
Oct 27, 2026
|
|
||
| ### Security-servicing exception: PowerShell tool discovery | ||
|
|
||
| On Windows, the Rust V1 |
There was a problem hiding this comment.
This versioning.md doc isn't about "things in specific versions" i.e. "thing X is in v1 for reason Y".
This doc is about the rules/dynamics of versioning.
Branden Bonaby (bbonaby)
approved these changes
Oct 27, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

This PR prevents Rust and Node V1 tool discovery from implicitly granting
recursive read access to the system-drive root when PowerShell is present.
It preserves tool-directory and PSReadLine history access, keeps
ProcessContainer errors actionable, and documents the security-servicing
exception within V1.
Details
recommending drive-root access.
temporary storage beneath the Windows directory does not filter them out.
discovered-path assertion in scheduled ProcessContainer tests.
the versioning policy, SDK READMEs, and API references.
Tests
cargo fmt --all -- --checkandcargo clippy -p mxc-sdk --lib --tests -- -D warningspassed.cargo test -p mxc-sdk --lib launch_diagnosticspassed (26 tests).The Rust discovery regression also passed (1 test).
before their fixes and passed afterward.
npm run buildandnpm run build:test-unitpassed.Copilot-Session: 76847b9f-ffd6-497e-95cb-e6d395704e3a
Copilot-Session: 1ce18a71-9051-4c4d-9d5f-23155754276f
Generated-with: gpt-6.1-sol
Microsoft Reviewers: Open in CodeFlow