Skip to content

Fix MessagePack - #14079

Merged
SergeyMenshykh merged 2 commits into
microsoft:mainfrom
SergeyMenshykh:sergeymenshykh/fix-messagepack-vulnerability
Jun 15, 2026
Merged

Fix MessagePack#14079
SergeyMenshykh merged 2 commits into
microsoft:mainfrom
SergeyMenshykh:sergeymenshykh/fix-messagepack-vulnerability

Conversation

@SergeyMenshykh

Copy link
Copy Markdown
Contributor

Pin MessagePack to 3.1.7 to resolve NU1903 error for known vulnerability in transitive dependency 2.5.192 brought in by Aspire packages.

Pin MessagePack to 3.1.7 to resolve NU1903 warning for known vulnerability
in transitive dependency 2.5.192 brought in by Aspire packages.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 15, 2026 15:55
@SergeyMenshykh
SergeyMenshykh requested a review from a team as a code owner June 15, 2026 15:55
@SergeyMenshykh SergeyMenshykh self-assigned this Jun 15, 2026
@SergeyMenshykh SergeyMenshykh moved this to In Review in Agent Framework Jun 15, 2026
@moonbox3 moonbox3 added the .NET Issue or Pull requests regarding .NET code label Jun 15, 2026
@github-actions github-actions Bot changed the title Fix MessagePack high severity vulnerability (GHSA-hv8m-jj95-wg3x) .Net: Fix MessagePack high severity vulnerability (GHSA-hv8m-jj95-wg3x) Jun 15, 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.

Pull request overview

Pins MessagePack to a non-vulnerable version to address the NU1903 security vulnerability warning triggered by Aspire packages in the .NET Aspire sample(s).

Changes:

  • Adds a central MessagePack package version (3.1.7) under dotnet/Directory.Packages.props.
  • Adds an explicit MessagePack package reference to the ChatWithAgent.AppHost project so the pinned version is actually used during restore.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.AppHost/ChatWithAgent.AppHost.csproj Adds an explicit MessagePack reference so the solution restores with the pinned (non-vulnerable) version.
dotnet/Directory.Packages.props Centrally pins MessagePack to 3.1.7 for CPM-managed restores.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions github-actions Bot 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.

Automated Code Review

Reviewers: 5 | Confidence: 91%

✓ Correctness

This PR correctly pins MessagePack to 3.1.7 in the central package management file (Directory.Packages.props) and adds an explicit PackageReference in the Aspire AppHost project to override the vulnerable transitive dependency (2.5.192). The approach follows standard .NET/NuGet patterns for resolving transitive dependency vulnerabilities with Central Package Management. The version 3.1.7 is above the fix threshold (2.6.100) for GHSA-hv8m-jj95-wg3x. No correctness issues found.

✓ Security Reliability

This PR correctly pins MessagePack to 3.1.7 to address the high-severity vulnerability GHSA-hv8m-jj95-wg3x in the transitive dependency 2.5.192 brought in by Aspire packages. The approach of adding a central PackageVersion entry plus a direct PackageReference in the affected project is the standard NuGet pattern for overriding vulnerable transitive dependencies. However, two other Aspire AppHost projects in the repo (ProcessFramework.Aspire.AppHost and ProcessFramework.Aspire.SignalR.AppHost) also reference Aspire.Hosting.AppHost and may have the same vulnerable transitive dependency without a corresponding direct PackageReference to force the override.

✓ Test Coverage

This PR pins the MessagePack transitive dependency to version 3.1.7 to fix a known high-severity vulnerability (GHSA-hv8m-jj95-wg3x) in version 2.5.192 brought in by Aspire packages. This is purely a build/dependency configuration change with no new or altered runtime behavior. No test coverage concerns exist—there is no new logic, feature, or behavioral change to test. The appropriate validation is that the project builds successfully with the updated dependency.

✓ Failure Modes

This PR pins MessagePack to 3.1.7 via Central Package Management to resolve a known high-severity vulnerability (GHSA-hv8m-j95-wg3x) in the transitive dependency version 2.5.192 brought in by Aspire packages. The change is straightforward and scoped appropriately. The version pin in Directory.Packages.props defines the version centrally, and the explicit PackageReference in ChatWithAgent.AppHost.csproj ensures the override applies to that project. No silent failure modes, swallowed exceptions, or operational risks are introduced by this change. If the version were incompatible with Aspire's expectations, NuGet restore or runtime loading would fail loudly rather than silently.

✗ Design Approach

The package pin itself is reasonable, but the current design only applies the transitive MessagePack override to one Aspire sample. Two other AppHost projects in the repo still reference Aspire packages through the same pattern without the direct override, so this does not fully address the stated repo-level vulnerability fix.

Flagged Issues

  • The MessagePack override is only wired into ChatWithAgent.AppHost, while dotnet/samples/Demos/ProcessFrameworkWithAspire/ProcessFramework.Aspire.AppHost/ProcessFramework.Aspire.AppHost.csproj:16 and dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.AppHost/ProcessFramework.Aspire.SignalR.AppHost.csproj:16-20 still consume Aspire packages without a direct MessagePack reference. The repo's existing pattern for transitive-vulnerability remediation is to add the overriding package directly in each affected project (dotnet/src/Functions/Functions.Prompty.csproj:21-23).

Automated review by SergeyMenshykh's agents

@github-actions

Copy link
Copy Markdown
Contributor

Flagged issue

The MessagePack override is only wired into ChatWithAgent.AppHost, while dotnet/samples/Demos/ProcessFrameworkWithAspire/ProcessFramework.Aspire.AppHost/ProcessFramework.Aspire.AppHost.csproj:16 and dotnet/samples/Demos/ProcessFrameworkWithSignalR/src/ProcessFramework.Aspire.SignalR.AppHost/ProcessFramework.Aspire.SignalR.AppHost.csproj:16-20 still consume Aspire packages without a direct MessagePack reference. The repo's existing pattern for transitive-vulnerability remediation is to add the overriding package directly in each affected project (dotnet/src/Functions/Functions.Prompty.csproj:21-23).


Source: automated DevFlow PR review

@SergeyMenshykh SergeyMenshykh changed the title .Net: Fix MessagePack high severity vulnerability (GHSA-hv8m-jj95-wg3x) Fix MessagePack high severity vulnerability Jun 15, 2026
@SergeyMenshykh

Copy link
Copy Markdown
Contributor Author

Addressed added direct MessagePack reference to both ProcessFramework.Aspire.AppHost and ProcessFramework.Aspire.SignalR.AppHost projects as well.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@SergeyMenshykh
SergeyMenshykh force-pushed the sergeymenshykh/fix-messagepack-vulnerability branch from 089106a to 4750aaf Compare June 15, 2026 16:30
@SergeyMenshykh
SergeyMenshykh enabled auto-merge June 15, 2026 17:00
@SergeyMenshykh
SergeyMenshykh added this pull request to the merge queue Jun 15, 2026
Merged via the queue into microsoft:main with commit f8c757b Jun 15, 2026
18 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in Agent Framework Jun 15, 2026
@moonbox3 moonbox3 changed the title Fix MessagePack high severity vulnerability Fix MessagePack Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET Issue or Pull requests regarding .NET code

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants