Skip to content

Pin MessagePack 2.5.307 in AI template AppHost project - #7853

Merged
evgenyfedorov2 merged 1 commit into
dotnet:mainfrom
evgenyfedorov2:evgenyfedorov2-fix-messagepack-vulnerability
Oct 16, 2026
Merged

evgenyfedorov2 merged 1 commit into
dotnet:mainfrom
evgenyfedorov2:evgenyfedorov2-fix-messagepack-vulnerability

Conversation

@evgenyfedorov2

@evgenyfedorov2 evgenyfedorov2 commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Fixes #7852

Aspire.Hosting.AppHost 13.4.6 pulls StreamJsonRpc 2.25.29 → MessagePack 2.5.302, which is flagged by GHSA-qhrr-8q5h-9q3h. With TreatWarningsAsErrors this fails restore of the generated AppHost project (NU1902), breaking the --aspire=true cases of AIChatWebExecutionTests.

Bumping Aspire doesn't help: the latest Aspire.Hosting.AppHost (13.6.1) still resolves MessagePack 2.5.302. So this pins MessagePack 2.5.307 in the AppHost template, same approach as #7561. 2.5.307 is used instead of 2.5.303 because GHSA-fx6j-x9m5-vmrf (< 2.5.305) and GHSA-7rj2-5w9w-r9jx (< 2.5.307) are also published for MessagePack.

The pin can be removed once Aspire picks up a fixed MessagePack version.

Microsoft Reviewers: Open in CodeFlow

Aspire.Hosting.AppHost 13.4.6 → Aspire.Hosting → StreamJsonRpc 2.25.29 → MessagePack 2.5.302,
which is affected by GHSA-qhrr-8q5h-9q3h. 2.5.307 also fixes GHSA-fx6j-x9m5-vmrf and GHSA-7rj2-5w9w-r9jx.

Fixes dotnet#7852

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 16, 2026 11:52
@evgenyfedorov2
evgenyfedorov2 requested review from a team as code owners October 16, 2026 11:52
@github-actions github-actions Bot added the area-ai-templates Microsoft.Extensions.AI.Templates label Oct 16, 2026
@evgenyfedorov2
evgenyfedorov2 enabled auto-merge (squash) October 16, 2026 11:53

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.

🟢 Approval recommended

The narrow dependency override and snapshots are consistent, with no blocking issues identified; builds and tests were not run.

0 open findings

What changed in this PR

Pins MessagePack 2.5.307 in generated AI chat AppHost projects to address vulnerable transitive dependencies and restore failures reported in #7852.

Changes:

  • Defines the patched version and adds a direct template package reference.
  • Updates all three affected AppHost snapshots.
File Description
test/​ProjectTemplates/​Microsoft.Extensions.AI.Templates.IntegrationTests/​Snapshots/​aichatweb/​aichatweb.o_q.verified/​aichatweb/​aichatweb.AppHost/​aichatweb.AppHost.csproj Updates Ollama/Qdrant snapshot.
test/​ProjectTemplates/​Microsoft.Extensions.AI.Templates.IntegrationTests/​Snapshots/​aichatweb/​aichatweb.A_oai.verified/​aichatweb/​aichatweb.AppHost/​aichatweb.AppHost.csproj Updates OpenAI snapshot.
test/​ProjectTemplates/​Microsoft.Extensions.AI.Templates.IntegrationTests/​Snapshots/​aichatweb/​aichatweb.A_aoai_aais.verified/​aichatweb/​aichatweb.AppHost/​aichatweb.AppHost.csproj Updates Azure OpenAI/Search snapshot.
src/​ProjectTemplates/​Microsoft.Extensions.AI.Templates/​templates/​AIChatWeb-CSharp/​AIChatWeb-CSharp.AppHost/​AIChatWeb-CSharp.AppHost.csproj-in Adds direct MessagePack reference.
eng/​packages/​ProjectTemplates.props Sets MessagePack to 2.5.307.

🧠 Review effort: Balanced


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

@dotnet-comment-bot

Copy link
Copy Markdown
Collaborator

‼️ Found issues ‼️

Project Coverage Type Expected Actual
Microsoft.Extensions.Diagnostics.Testing Line 99 98.65 🔻
Microsoft.Extensions.Telemetry Line 93 92.75 🔻
Microsoft.Extensions.AI Line 89 88.4 🔻
Microsoft.Extensions.AI.OpenAI Line 75 68.24 🔻
Microsoft.Extensions.AI.OpenAI Branch 75 57.54 🔻
Microsoft.Extensions.DataIngestion.MarkItDown Line 75 4.46 🔻
Microsoft.Extensions.DataIngestion.MarkItDown Branch 75 0 🔻
Microsoft.Extensions.Diagnostics.ResourceMonitoring Line 99 96.07 🔻
Microsoft.Extensions.Diagnostics.ResourceMonitoring Branch 99 92.76 🔻
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Kubernetes Line 99 97.73 🔻
Microsoft.Extensions.ServiceDiscovery.Abstractions Line 75 42.11 🔻
Microsoft.Extensions.ServiceDiscovery.Abstractions Branch 75 42.86 🔻
Microsoft.Extensions.ServiceDiscovery.Dns Line 75 71.61 🔻
Microsoft.Extensions.ServiceDiscovery Line 75 68.11 🔻
Microsoft.Extensions.ServiceDiscovery Branch 75 71.43 🔻
Microsoft.Extensions.ServiceDiscovery.Yarp Line 75 73.85 🔻
Microsoft.Extensions.ServiceDiscovery.Yarp Branch 75 70 🔻
Microsoft.Extensions.VectorData.Abstractions Line 75 37.39 🔻
Microsoft.Extensions.VectorData.Abstractions Branch 75 22.73 🔻

🎉 Good job! The coverage increased 🎉
Update MinCodeCoverage in the project files.

Project Expected Actual
Microsoft.Extensions.Http.Diagnostics 94 95
Microsoft.Gen.BuildMetadata 97 100
Microsoft.Gen.MetadataExtractor 57 73
Microsoft.Gen.MetricsReports 67 69
Microsoft.Extensions.AI.Abstractions 82 86
Microsoft.Extensions.AI.Evaluation.NLP 0 78
Microsoft.Extensions.Caching.Hybrid 82 85
Microsoft.Extensions.DataIngestion 75 89
Microsoft.Extensions.DataIngestion.Markdig 75 90
Microsoft.Extensions.Http.Resilience 97 100

Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1638094&view=codecoverage-tab

@evgenyfedorov2
evgenyfedorov2 merged commit ed3d8e4 into dotnet:main Oct 16, 2026
7 checks passed
evgenyfedorov2 pushed a commit to evgenyfedorov2/dotnet-extensions that referenced this pull request Nov 12, 2026
Aspire.Hosting 13.6.5 depends on MessagePack 2.5.307 itself, the version
pinned in dotnet#7853, so the pin no longer changes the resolved version.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-ai-templates Microsoft.Extensions.AI.Templates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI template AppHost restore fails with NU1902 for MessagePack 2.5.302

4 participants