Skip to content

COM server security improvements - #6568

Merged
JohnMcPMS merged 17 commits into
microsoft:release-v1.29from
JohnMcPMS:rpc-sec
Sep 25, 2026
Merged

JohnMcPMS merged 17 commits into
microsoft:release-v1.29from
JohnMcPMS:rpc-sec

Conversation

@JohnMcPMS

@JohnMcPMS JohnMcPMS commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

📖 Description

Enhances COM server security posture.

🔍 Validation

Added extensive tests.

Microsoft Reviewers: Open in CodeFlow

@JohnMcPMS
JohnMcPMS requested a review from a team as a code owner September 25, 2026 22:55
@github-actions

This comment was marked as outdated.

@JohnMcPMS
JohnMcPMS merged commit f39aff2 into microsoft:release-v1.29 Sep 25, 2026
4 checks passed
@JohnMcPMS
JohnMcPMS deleted the rpc-sec branch September 25, 2026 23: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.

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 High severity · 2 Medium severity

Open (6)
What changed in this PR

Hardens WinGet’s manual-activation RPC channel and adds security-focused E2E coverage.

Changes:

  • Migrates RPC transport to authenticated ncalrpc with 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 thread src/AppInstallerCLI.sln
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} };
@Trenly

Copy link
Copy Markdown
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.
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