Skip to content

COM server security improvements - #6569

Open
JohnMcPMS wants to merge 8 commits into
microsoft:masterfrom
JohnMcPMS:rpc-sec-main
Open

JohnMcPMS wants to merge 8 commits into
microsoft:masterfrom
JohnMcPMS:rpc-sec-main

Conversation

@JohnMcPMS

@JohnMcPMS JohnMcPMS commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

📖 Description

Cherry pick #6568 to main.

Microsoft Reviewers: Open in CodeFlow

## 📖 Description
Enhances COM server security posture.
@JohnMcPMS
JohnMcPMS requested a review from a team as a code owner September 25, 2026 23:12
yao-msft
yao-msft previously approved these changes Sep 25, 2026

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.

Copilot review overview

🟡 Changes recommended

Named-object pre-creation vulnerabilities and several build and test reliability defects remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 4 High severity · 3 Medium severity · 1 Low severity

Open (8)
What changed in this PR

Cherry-picks COM server security hardening and accompanying E2E coverage.

Changes:

  • Migrates manual activation to authenticated ncalrpc.
  • Adds per-user synchronization security and RPC management denial.
  • Adds an RPC security test helper and explicit E2E tests.
File Description
src/​WinGetServer/​WinMain.cpp Hardens RPC server registration and lifetime locking.
src/​WinGetServer/​WinGetServerManualActivation_Client.h Adds a test-only launch suppression flag.
src/​WinGetServer/​WinGetServerManualActivation_Client.cpp Configures authenticated RPC client bindings.
src/​WinGetServer/​Utils.h Declares security and synchronization helpers.
src/​WinGetServer/​Utils.cpp Implements secured per-user objects and SID utilities.
src/​WinGetRpcTestHelper/​WinGetRpcTestHelper.vcxproj Defines the native security test helper.
src/​WinGetRpcTestHelper/​WinGetRpcTestHelper.cpp Implements RPC and object-security probes.
src/​WinGetRpcTestHelper/​packages.config Adds the WIL dependency.
src/​AppInstallerCLIE2ETests/​RpcSecurityTests.cs Adds explicit RPC security E2E tests.
src/​AppInstallerCLIE2ETests/​Helpers/​TestSetup.cs Adds executable path parameters.
src/​AppInstallerCLIE2ETests/​Constants.cs Defines the new parameter names.
src/​AppInstallerCLI.sln Registers the helper project.
.github/​actions/​spelling/​expect.txt Adds expected technical terms.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/WinGetRpcTestHelper/WinGetRpcTestHelper.cpp
Comment thread src/WinGetServer/Utils.cpp Outdated
Comment thread src/WinGetServer/Utils.cpp Outdated
Comment thread src/WinGetServer/Utils.cpp Outdated
Comment thread src/AppInstallerCLI.sln
Comment thread src/AppInstallerCLIE2ETests/RpcSecurityTests.cs Outdated
Comment thread src/WinGetRpcTestHelper/WinGetRpcTestHelper.cpp
Comment thread src/AppInstallerCLIE2ETests/Helpers/TestSetup.cs
@github-actions

This comment was marked as outdated.

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.

Comment thread src/WinGetServer/Utils.cpp

@ranm-msft ranm-msft 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.

I walked the security path here rather than the diff shape. The invariant I was checking is that manual activation should only succeed between the same user at high integrity and the genuine server, and that a medium-integrity process running as the same user should not be able to squat an endpoint-adjacent named object or convince the client to accept a fake server.

I did not find a bypass at the head. The endpoint and interface descriptors both carry the restriction, the client requires mutual authentication against a server security descriptor rather than trusting the binding, the synchronization objects that actually gate activation moved into a high-integrity current-user private namespace, and the descriptor is validated on open instead of being assumed. The pre-creation concerns raised on the release branch version look materially answered by that pairing, and denying the management interface is a sensible narrowing.

I am not going to treat my read as sufficient to approve this one. It is security boundary code, and I would want the owner's approval recorded against this exact head rather than an earlier commit.

The one item I would not want to lose is the existing thread about the public readiness event name no longer matching what shipped clients wait on. That reads to me as a compatibility and timeout risk rather than an authentication one, but it deserves a deliberate answer before merge rather than being carried along.

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.

4 participants