Clear known NuGet vulnerabilities in OpenAPI and Mediator - #10178
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses known NuGet security advisories by adjusting dependency resolution in the OpenAPI adapter (net10.0) and removing a vulnerable transitive dependency from the Mediator benchmark project via package bumps.
Changes:
- Add a net10.0-conditional
PackageReferencewithVersionOverride="2.7.5"forMicrosoft.OpenApiinHotChocolate.Adapters.OpenApi.AspNetCoreto avoid resolving the vulnerable 2.0.0 line. - Bump
Mediator.AbstractionsandMediator.SourceGeneratorfrom 3.0.1 to 3.0.2 inMocha.Mediator.Benchmarksto eliminateScriban6.2.0 from the package graph.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Mocha/benchmarks/Mocha.Mediator.Benchmarks/Mocha.Mediator.Benchmarks.csproj | Updates Mediator package overrides to 3.0.2 to remove vulnerable transitive dependencies from the benchmark project. |
| src/HotChocolate/Adapters/src/Adapters.OpenApi.AspNetCore/HotChocolate.Adapters.OpenApi.AspNetCore.csproj | Pins Microsoft.OpenApi to 2.7.5 for net10.0 builds to ensure a patched version is used and flows to consumers via the package dependency group. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Aug 9, 2026
Merged
Open
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.
Summary
Microsoft.OpenApi2.0.0 resolved transitively on net10.0 throughMicrosoft.AspNetCore.OpenApi10.0.0, carrying GHSA-v5pm-xwqc-g5wc (high, stack overflow on circular schema references). NoMicrosoft.AspNetCore.OpenApi10.0.x raises itsMicrosoft.OpenApi [2.0.0, )floor, so a parent bump cannot clear it. Pinned to 2.7.5 with a net10.0-conditionalVersionOverrideinHotChocolate.Adapters.OpenApi.AspNetCore; that single pin lifts all six affected projects through the project-reference graph. The condition and theVersionOverrideare both load-bearing: net9.0 resolves the unaffected 1.6.x line, net11.0 already resolves a patched 3.x, and the CPM scope declaresMicrosoft.OpenApi1.6.14, which a bare reference would downgrade to.Scriban6.2.0 reachedMocha.Mediator.BenchmarksthroughMediator.SourceGenerator3.0.1, carrying 14 advisories (1 critical, 9 high, 4 moderate).Mediator3.0.2 declares no package dependencies at all, so bumping the coupledMediator.Abstractions/Mediator.SourceGeneratorpair removesScribanfrom the graph.HotChocolate.Adapters.OpenApi.AspNetCore's published nuspec gains a directMicrosoft.OpenApi >= 2.7.5on its net10.0 dependency group. That is the intended mechanism for stopping consumers resolving the vulnerable version, but it is a change to what the package declares.One caveat worth recording:
Mediator.SourceGenerator3.0.2 does not upgradeScribanas a package, it ILMergesScriban7.0.0 into the analyzer assembly. That clears 11 of the 14 advisories including the critical one, but four survive as embedded code thatdotnet list package --vulnerablecan no longer see. All four are build-time only, in a benchmark project that never packs, driven by templates embedded in the generator.Test plan
dotnet restore src/All.slnx --force-evaluate— clean across all 304 projects, noNU1903,NU1605, orNU1608dotnet list src/All.slnx package --vulnerable --include-transitive— zero vulnerable packages; the 36 projects outsideAll.slnxaudited individually and also cleandotnet build src/HotChocolate/Adapters/Adapters.slnx— greendotnet test HotChocolate.Adapters.OpenApi.Tests --framework net10.0— 231 passed, 2 skipped, 0 failedMediator.SourceGenerator3.0.2 still emits its generated sources, confirming codegen works on the mergedScribanMocha.Mediator.Benchmarksdoes not compile, before or after this change — 22 pre-existingRCS1163errors in its own source, identical at 3.0.1 and 3.0.2. It is absent from every.slnx, so CI never builds it. Not addressed here.