Skip to content

[release/10.0.1xx] Fix nuget audit failures for msbuild dependencies - #7766

Closed
mmitche wants to merge 4 commits into
dotnet:release/10.0.1xxfrom
mmitche:dev/mmitche/nuget-audit-fixes
Closed

mmitche wants to merge 4 commits into
dotnet:release/10.0.1xxfrom
mmitche:dev/mmitche/nuget-audit-fixes

Conversation

@mmitche

@mmitche mmitche commented Jul 15, 2026

Copy link
Copy Markdown
Member

Resolves the NuGet audit (NU1902/NU1903) failures in the dotnet-unified-build (build 3022982).

Changes (all under src/msbuild):

  • Bump System.Security.Cryptography.Xml 9.0.0 → 9.0.15 (fixes GHSA-37gx-xxp4-5rgx, GHSA-w3x6-4m5h-cxqf; high).
  • Pin transitive OpenTelemetry.Api to 1.15.3 (fixes GHSA-g94r-2vxg-569j / CVE-2026-40894; moderate). The Microsoft.VisualStudio.OpenTelemetry.* packages still reference the vulnerable 1.9.0 even at their latest version (1.0.2), so a direct pin is required.

The SQLitePCLRaw advisory (GHSA-2m69-gcr7-jv3q) is intentionally not addressed here — its only fix is a major 2.x → 3.x jump and will be handled separately if necessary.

Validation official build (dnceng/internal dotnet-unified-build): https://dev.azure.com/dnceng/internal/_build/results?buildId=3023440

Resolve NU1902/NU1903 audit failures reported by the dotnet-unified-build:
- Bump System.Security.Cryptography.Xml 9.0.0 -> 9.0.15 (GHSA-37gx-xxp4-5rgx,
  GHSA-w3x6-4m5h-cxqf).
- Pin transitive OpenTelemetry.Api to 1.15.3 to pick up the fix for
  GHSA-g94r-2vxg-569j (CVE-2026-40894); the Microsoft.VisualStudio.OpenTelemetry.*
  packages still reference the vulnerable 1.9.0 even at their latest version.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: bc63fc57-da4d-4945-bcfd-7a438341ffc7
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@mmitche
mmitche requested a review from rainersigwald July 15, 2026 20:41
@mmitche

mmitche commented Jul 15, 2026

Copy link
Copy Markdown
Member Author

@rainersigwald and msbuild folks....take a look and make sure none of those are getting bumped over their VS maximums.

@mmitche

mmitche commented Jul 15, 2026

Copy link
Copy Markdown
Member Author

/cc @dkurepa

@rainersigwald rainersigwald left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

18.0 is not in support for VS so it doesn't matter :)

@dkurepa dkurepa changed the title Fix nuget audit failures for msbuild dependencies [release/10.0.1xx] Fix nuget audit failures for msbuild dependencies Jul 16, 2026
@mmitche

mmitche commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

The  System.Memory  assembly bump to  4.0.5.0  landed in 1.14.0, but the advisory (GHSA-g94r-2vxg-569j) isn't fixed until 1.15.3. So there's no overlap — every non-vulnerable version (≥ 1.15.3) hard-binds  System.Memory 4.0.5.0  and will collide with MSBuild's frozen 4.5.5 on net472. The last version that keeps the compatible  4.0.1.2  is 1.13.1, which is still vulnerable.

@mmitche

mmitche commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

@rainersigwald In order to resolve the OTel issue we'll have to update the System.Memory version to 4.6.3..any concerns there?

@rainersigwald

Copy link
Copy Markdown
Member

Nope, the "frozen" stuff is VS-only so change whatever in this branch.

…3 on net472

OpenTelemetry.Api 1.15.3 (the first non-vulnerable version for GHSA-g94r-2vxg-569j) hard-binds System.Memory 4.0.5.0, but MSBuild's frozen maintenance-package mechanism forced net472 compiles down to System.Memory 4.5.5 (assembly 4.0.1.2), causing an MSB3277 conflict in Microsoft.Build.Framework.csproj.

Per guidance from @rainersigwald (the frozen versions are only for VS compatibility and can change on this branch), bump the frozen System.Memory to 4.6.3 (assembly 4.0.5.0) and its companions (System.Buffers 4.6.1, System.Numerics.Vectors 4.6.1, System.Runtime.CompilerServices.Unsafe 6.1.2) to the versions System.Memory 4.6.3 declares as dependencies. Align the distributed (non-source-build) versions and the app.config/app.amd64.config binding redirects + codeBase entries with these assembly versions so runtime resolution stays consistent.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: bc63fc57-da4d-4945-bcfd-7a438341ffc7
@mmitche

mmitche commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

Pushed the System.Memory fix (commit 37e1fe4).

What changed (per @rainersigwald's OK to change the frozen versions on this branch):

  • Bumped the frozen net472 compile references so Microsoft.Build.Framework compiles against System.Memory 4.6.3 (assembly 4.0.5.0) instead of 4.5.5 (4.0.1.2), matching what OpenTelemetry.Api 1.15.3 hard-binds. This resolves the MSB3277 conflict.
  • Bumped the companion frozen packages to exactly the versions System.Memory 4.6.3 declares as dependencies: System.Buffers 4.6.1, System.Numerics.Vectors 4.6.1, System.Runtime.CompilerServices.Unsafe 6.1.2 (and switched their frozen lib paths from net461/net46 to net462, which is the only TFM shipped by the 4.6.x packages).
  • Aligned the distributed (non-source-build) versions and the app.config / app.amd64.config binding redirects + codeBase entries to the same assembly versions (4.0.5.0 / 4.1.6.0 / 6.0.3.0) so runtime resolution stays consistent.

I confirmed via the failing build's log that System.Memory was the only MSB3277 conflict; DiagnosticSource (which 1.15.3 also pulls to 10.0.0) resolves fine.

Queued official validation build (internal) 3024287 and the public PR build is running on this push.

…3 on net472

OpenTelemetry.Api 1.15.3 references System.Diagnostics.DiagnosticSource 10.0.0.0
on net472, which conflicted (MSB3277) with the pinned 9.0.0 (asm 9.0.0.0). Bump
the manual (source-build live) DiagnosticSource dependency to 10.0.0 and update
the app.config/app.amd64.config binding redirects + codeBase accordingly. Its
transitive deps (System.Memory/Buffers/Unsafe) are already satisfied by the
System.Memory 4.6.3 family bump.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: bc63fc57-da4d-4945-bcfd-7a438341ffc7
@mmitche

mmitche commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

@rainersigwald ... e52e6c9

Now an upgrade to 10.0.0...makes me want to look at that OTel suppression a bit more.

@dkurepa

dkurepa commented Jul 17, 2026

Copy link
Copy Markdown
Member

@ViktorHofer do you think we should merge this as is, or try to go with the suppression for the Open Telemetry?

@dkurepa

dkurepa commented Jul 20, 2026

Copy link
Copy Markdown
Member

the alternative doesn't seem to be green. Can we merge this PR to get 1xx unblocked?

@ViktorHofer ViktorHofer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a comment in #7821 (comment). I don't think that this PR or the alternative one are the right paths. I left a proposal in that other comment with in my opinion the right solution for the current state that we are in.

For future it would be really to good to avoid these kind of issues by offering a real targeting pack solution for msbuild. These days with package pruning, 90% of nuget audit warnings/errors are due to msbuild and should be considered false positives.

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