fix(network): scope Windows egress by socket owner - #3491
Open
prekshivyas wants to merge 5 commits into
Open
prekshivyas wants to merge 5 commits into
prekshivyas wants to merge 5 commits into
Conversation
NVBug 6783086 Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Resolve each accepted Windows proxy connection to its unique owning PID and executable before evaluating binary-scoped network policy. Fail closed when ownership or process identity cannot be established, and cover allowed and undeclared child processes with a real MXC regression.
prekshivyas
requested review from
a team,
derekwaynecarr,
mrunalp and
sjenning
as code owners
September 20, 2026 04:30
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com> (cherry picked from commit 32ea316deb6c83c157fdf2de4a2cdc3a7d2da1e3)
Contributor
Author
|
Combined Windows-NVBug qualification exposed and fixed a cross-PR compatibility regression with #3434. #3434 attaches immutable per-sandbox OCSF context to the former static Windows proxy identity; this PR replaces that identity with per-socket Windows process ownership. When both heads were merged, the audit-context methods still matched the removed Pushed:
Validation on native Windows ARM64:
This PR is now intentionally stacked on #3434. Once #3434 merges into |
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.
Summary
Fixes a Windows MXC authorization defect by authorizing each proxied TCP connection as the process that actually owns the workload-side socket.
The Windows host proxy previously evaluated every connection with one static identity:
command[0], captured when the sandbox started. As a result, a child process could inherit the entry command's allow grant, while a policy explicitly granting the child binary did not authorize it.Change
GetExtendedTcpTable(OWNER_PID_ALL)QueryFullProcessImageNameWBefore / after evidence
Environment: Yukon Windows ARM64; Rust 1.95; MXC
wxc-exec.exe0.8.0+7dac1a9 (ARM64).Pre-fix reproduction on unmodified
windowstipfb2980e077288b61ef03a2e6187e162d158526aa, usingcmd.exe /c curl.exe https://example.com/:curl.exe: denied with HTTP 403 / curl exit 22 /ExecFailed; test exit 101; scenario 0.63 scmd.exe: child curl succeeds; test exit 0; scenario 0.70 sThat inversion proves the proxy was using the static parent identity rather than the socket owner.
Post-fix commit
3a902900ed7d0d995b3e58ace3f5e0fe9bd32e80, rebased onto currentwindowsbase4f06e23cc8e4bfb48f78f43645771683f674fe2d:curl.exe: HTTPS succeeds and produces a non-empty responsecmd.exe: child curl is denied with HTTP 403 /ExecFailedVerification
cargo test -p openshell-supervisor-network --lib --target aarch64-pc-windows-msvc windows_process::tests -- --nocapture— 2 passedcargo test -p openshell-supervisor-network --lib --target aarch64-pc-windows-msvc per_sandbox_credentials_reject_missing_wrong_cross_and_duplicate_auth -- --nocapture— 1 passedcargo test -p openshell-driver-mxc --test wxc_exec_real --target aarch64-pc-windows-msvc pc_proxy_scopes_network_policy_to_socket_owner -- --ignored --test-threads=1 --nocapture— 1 passed, 1.04 smise run --jobs 1 pre-commiton the rebased tree — exit 0, 219.975 scargo fmt --all -- --checkand focused Windows ARM64 Clippy — passgit diff --check— passThe full Windows gate used the installed x64 Biome binary because Biome's native ARM64 executable crashes on this host, plus the official Z3 4.16.0 ARM64 release because the unauthenticated prebuilt download endpoint returned HTTP 403.
Security impact
This removes an authorization-broadening path: an allowed Windows entry process no longer lends its binary-scoped network permissions to arbitrary descendants. Identity failures deny the request; they do not fall back to entry-command or endpoint-only authorization.
Scope and residual risk
This is intentionally limited to Windows proxy process-identity binding. It does not normalize Windows path spelling or case; that separate behavior remains tracked separately. The latest base already contains the independent governed-proxy lifecycle fix.
Validation was performed on native Windows ARM64 with real ARM64 MXC. x64 compilation/CI remains expected coverage. A process that exits before its image can be queried is denied, which is the intended fail-closed behavior.