Repository navigation
Conversation
…lemetry.* Alternative approach to fixing the NuGet audit failure (GHSA-g94r-2vxg-569j / CVE-2026-40894) reported against the transitive OpenTelemetry.Api pulled in by Microsoft.VisualStudio.OpenTelemetry.Collector/ClientExtensions. Those refs are in the '.NETFramework'-only ItemGroup, so targeting only .NET Core + netstandard2.0 removes the vulnerable dependency without upgrading OpenTelemetry.Api (which would otherwise cascade into System.Memory/DiagnosticSource assembly-version conflicts on net472). Trade-off: the net472 flavor of Microsoft.Build.Framework is consumed by the rest of MSBuild's net472 (Visual Studio) build, so this is offered as an alternative to PR dotnet#7766 for evaluation, not a drop-in change. Co-authored-by: Copilot <[email protected]> Copilot-Session: bc63fc57-da4d-4945-bcfd-7a438341ffc7
|
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. |
|
I was under the impression that today VS is the primary consumer of our OTel-based metrics, via the VS-only OTel Collectors we have? If that is the case then not including OTel deps seems like it would defeat the purpose. cc @JanProvaznik |
Fold in the approach-independent audit fixes so this PR resolves all reported NU1902/NU1903 failures on its own: - System.Security.Cryptography.Xml 9.0.0 -> 9.0.15 (GHSA-37gx-xxp4-5rgx, GHSA-w3x6-4m5h-cxqf) - System.Formats.Asn1 9.0.6 -> 9.0.15 - System.Security.Cryptography.Pkcs 9.0.6 -> 9.0.15 The OpenTelemetry advisory is handled separately by dropping net472 from Microsoft.Build.Framework (no OpenTelemetry.Api upgrade / DiagnosticSource bump). Co-authored-by: Copilot <[email protected]> Copilot-Session: bc63fc57-da4d-4945-bcfd-7a438341ffc7
VS 18.0 isn't in support any longer, and we don't include the net framework version of msbuild in the SDK (I think) |
|
I don't like this because if we needed to service 18.0 nugets (still 2+ years in support IIRC) the net472 should remain inside even though that VS is out of support. But I am not sure what's our exact support contract with nugets. |
|
and @baronfel VS is no longer the consumer because we removed otel in ~18.4 |
We build & ship the NuGet packages from our repo so we can always revive the TF and reship if we need to for a security event. |
|
I also don't like this approach for the stated reason but also for a another one. These change automatically flow forward to newer in support branches: vs18.0 -> vs18.6. We would need to revert these which is fine but unusual. I would instead silence that NuGet Audit report via the |
Is that the correct fix for OTel? I understand with the S.S.C.Xml since msbuild is only referencing surface area..but is that same thing with OTel? |
|
Right, that is only correct for compile-time only dependencies. |
|
I think stop building the TFM is a big hammer. I don't want to see that code flowing forward anywhere, accidentally. Suppressing the audit report sounds like the better option if there aren't any downstream consumers of it. |
|
Hmm. If we update OTel, it pulls SystemDiagnosticsDiagnosticSourcePackageVersion forward from 9.0 to 10.0. |
|
OTel is also just a compile time dependency, I just checked. Suppress the warning. |
Alternative approach: drop net472 from
Microsoft.Build.FrameworkThis is an alternative to #7766 for resolving the NuGet audit failures (
NU1902/NU1903). The novel part is how the OpenTelemetry advisory (GHSA-g94r-2vxg-569j / CVE-2026-40894) is handled: instead of upgradingOpenTelemetry.Api, dropnet472targeting.OpenTelemetry advisory - the alternative approach
OpenTelemetry.Apiis pulled in transitively byMicrosoft.VisualStudio.OpenTelemetry.Collector/Microsoft.VisualStudio.OpenTelemetry.ClientExtensions, which live in the.NETFramework-onlyItemGroupinMicrosoft.Build.Framework.csproj. By targeting only.NET Core + netstandard2.0(droppingnet472), the vulnerable dependency is never restored - noOpenTelemetry.Apiupgrade.This sidesteps the cascade the OTel upgrade triggers in #7766: net472
MSB3277assembly-version conflicts (System.Memory->System.Diagnostics.DiagnosticSource), each needing frozen-maintenance-package bumps + binding-redirect updates.Remaining audit fixes (folded in, approach-independent)
Same bumps as in #7766 so this PR resolves all reported audit failures on its own:
System.Security.Cryptography.Xml9.0.0 -> 9.0.15 (GHSA-37gx-xxp4-5rgx, GHSA-w3x6-4m5h-cxqf)System.Formats.Asn19.0.6 -> 9.0.15System.Security.Cryptography.Pkcs9.0.6 -> 9.0.15Trade-off / caveat
The
net472flavor ofMicrosoft.Build.Frameworkis consumed by the rest of MSBuild'snet472(Visual Studio) build. Dropping it here will break the net472 build of the rest of MSBuild, so this is offered for evaluation of the approach vs. #7766, not a drop-in change.cc @rainersigwald