Repository navigation
COM server security improvements - #6568
Merged
Merged
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Flor Chacón (florelis)
approved these changes
Sep 25, 2026
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Predictable synchronization objects remain vulnerable to pre-creation, and several build and test reliability issues are unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 4
Open (6)
Missing WinGetServer project dependency breaks clean parallel builds · New Test helper fails when test hooks are disabled · New Win32 security failures incorrectly weaken endpoint protections · New Predictable mutex can be pre-created to block server startup · New Server process leaks when readiness fails · New Hard-coded development CLSID breaks production CLSID builds · New
What changed in this PR
Hardens WinGet’s manual-activation RPC channel and adds security-focused E2E coverage.
Changes:
- Migrates RPC transport to authenticated
ncalrpcwith endpoint/interface access controls. - Secures server synchronization objects and RPC management operations.
- Adds an RPC test helper and elevated security tests.
| File | Description |
|---|---|
src/WinGetServer/WinMain.cpp |
Configures secured RPC server transport and mutex lifetime. |
src/WinGetServer/WinGetServerManualActivation_Client.h |
Defines a test-only no-launch flag. |
src/WinGetServer/WinGetServerManualActivation_Client.cpp |
Adds authenticated RPC client binding. |
src/WinGetServer/Utils.h |
Declares security and synchronization helpers. |
src/WinGetServer/Utils.cpp |
Implements SID-based names and secured objects. |
src/WinGetRpcTestHelper/WinGetRpcTestHelper.vcxproj |
Adds the native RPC test helper project. |
src/WinGetRpcTestHelper/WinGetRpcTestHelper.cpp |
Implements RPC and synchronization 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 server and helper path parameters. |
src/AppInstallerCLIE2ETests/Constants.cs |
Defines the new parameter names. |
src/AppInstallerCLI.sln |
Registers the test 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 on lines
+235
to
+236
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinGetRpcTestHelper", "WinGetRpcTestHelper\WinGetRpcTestHelper.vcxproj", "{3F7A8E42-C1D5-4B9F-A2E6-D8C0F73B5412}" | ||
| EndProject |
Comment on lines
+145
to
+146
| HRESULT hr = WinGetServerManualActivation_CreateInstance( | ||
| s_clsidFindPackagesOptions, IID_IUnknown, WinGetServerManualActivation_TestHookFlag_NoServerLaunch, &out); |
Comment on lines
+61
to
+65
| if (AllocateAndInitializeSid(&ntAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &adminGroup)) | ||
| { | ||
| CheckTokenMembership(nullptr, adminGroup, &result); | ||
| FreeSid(adminGroup); | ||
| } |
Comment on lines
+122
to
+125
| std::wstring name = GetServerMutexName(); | ||
|
|
||
| wil::unique_mutex result; | ||
| THROW_LAST_ERROR_IF(!result.try_create(name.c_str(), 0, MUTEX_ALL_ACCESS, &securityAttributes)); |
Comment on lines
+438
to
+443
| var proc = Process.Start(startInfo) | ||
| ?? throw new InvalidOperationException("Failed to start WinGetServer"); | ||
|
|
||
| string readyEventName = "WinGetServerStartEvent_" + sid; | ||
| this.WaitForServerReadyEvent(readyEventName, proc); | ||
| return proc; |
Comment on lines
+133
to
+136
| // WINGET_INPROC_COM_CLSID_FindPackagesOptions — a simple options object the server | ||
| // can create with no side-effects, so the call exercises the security configuration | ||
| // rather than failing early on an unavailable class. | ||
| static const CLSID s_clsidFindPackagesOptions = { 0x1bd8ff3a,0xec50,0x4f69,{0xae,0xee,0xdf,0x4c,0x9d,0x3b,0xaa,0x96} }; |
Contributor
|
JohnMcPMS - Is there a plan to revisit the copilot findings later? |
JohnMcPMS
added a commit
that referenced
this pull request
Oct 1, 2026
## 📖 Description Cherry pick #6568 to main.
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.


📖 Description
Enhances COM server security posture.
🔍 Validation
Added extensive tests.
Microsoft Reviewers: Open in CodeFlow