Skip to content

Bump net8/net9/net10 runtime package baselines to patched crypto servicing versions#3779

Merged
gladjohn merged 4 commits intomasterfrom
copilot/fix-nuget-restore-errors
Apr 16, 2026
Merged

Bump net8/net9/net10 runtime package baselines to patched crypto servicing versions#3779
gladjohn merged 4 commits intomasterfrom
copilot/fix-nuget-restore-errors

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 15, 2026

dotnet restore was failing with NU1901 because System.Security.Cryptography.Xml resolved to vulnerable versions across net8.0, net9.0, and net10.0, and warnings are treated as errors. This change moves the runtime-derived version baselines to patched servicing releases so vulnerable crypto packages are no longer selected.

  • Runtime servicing alignment (net9/net10)

    • Updated Directory.Build.props:
      • NetNineRuntimeVersion9.0.15
      • AspNetCoreNineRuntimeVersion9.0.15
      • NetTenRuntimeVersion10.0.6
      • AspNetCoreTenRuntimeVersion10.0.6
    • This updates all runtime-derived package versions consistently for each TFM.
  • Direct crypto package patch (net8)

    • Updated SystemSecurityCryptographyXmlVersion from 8.0.1 to 8.0.3 in the net8.0 property group.
  • Dependency graph consistency fix

    • While applying the net8 XML patch, restore surfaced a downgrade (NU1605) because Xml 8.0.3 requires Pkcs >= 8.0.1.
    • Updated SystemSecurityCryptographyPkcsVersion from 8.0.0 to 8.0.1 in the net8.0 property group.
<PropertyGroup Condition="'$(TargetFramework)' == 'net9.0'">
  <NetNineRuntimeVersion>9.0.15</NetNineRuntimeVersion>
  <AspNetCoreNineRuntimeVersion>9.0.15</AspNetCoreNineRuntimeVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net10.0'">
  <NetTenRuntimeVersion>10.0.6</NetTenRuntimeVersion>
  <AspNetCoreTenRuntimeVersion>10.0.6</AspNetCoreTenRuntimeVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
  <SystemSecurityCryptographyPkcsVersion>8.0.1</SystemSecurityCryptographyPkcsVersion>
  <SystemSecurityCryptographyXmlVersion>8.0.3</SystemSecurityCryptographyXmlVersion>
</PropertyGroup>

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • login.microsoftonline.com
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/microsoft-identity-web/microsoft-identity-web/tests/Microsoft.Identity.Web.Test/bin/Debug/net10.0/Microsoft.Identity.Web.Test.runtimeconfig.json --depsfile /home/REDACTED/work/microsoft-identity-web/microsoft-identity-web/tests/Microsoft.Identity.Web.Test/bin/Debug/net10.0/Microsoft.Identity.Web.Test.deps.json /home/REDACTED/work/microsoft-identity-web/microsoft-identity-web/tests/Microsoft.Identity.Web.Test/bin/Debug/net10.0/testhost.dll --port 43459 --endpoint 127.0.0.1:043459 --role client --parentprocessid 5118 --telemetryoptedin false (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/microsoft-identity-web/microsoft-identity-web/tests/Microsoft.Identity.Web.Test/bin/Debug/net8.0/Microsoft.Identity.Web.Test.runtimeconfig.json --depsfile /home/REDACTED/work/microsoft-identity-web/microsoft-identity-web/tests/Microsoft.Identity.Web.Test/bin/Debug/net8.0/Microsoft.Identity.Web.Test.deps.json /home/REDACTED/work/microsoft-identity-web/microsoft-identity-web/tests/Microsoft.Identity.Web.Test/bin/Debug/net8.0/testhost.dll --port 35581 --endpoint 127.0.0.1:035581 --role client --parentprocessid 5125 --telemetryoptedin false (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/microsoft-identity-web/microsoft-identity-web/tests/Microsoft.Identity.Web.Test/bin/Debug/net9.0/Microsoft.Identity.Web.Test.runtimeconfig.json --depsfile /home/REDACTED/work/microsoft-identity-web/microsoft-identity-web/tests/Microsoft.Identity.Web.Test/bin/Debug/net9.0/Microsoft.Identity.Web.Test.deps.json /home/REDACTED/work/microsoft-identity-web/microsoft-identity-web/tests/Microsoft.Identity.Web.Test/bin/Debug/net9.0/testhost.dll --port 37883 --endpoint 127.0.0.1:037883 --role client --parentprocessid 5117 --telemetryoptedin false (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Problem

The build is failing with NU1901 errors because System.Security.Cryptography.Xml has known low-severity vulnerabilities (GHSA-37gx-xxp4-5rgx and GHSA-w3x6-4m5h-cxqf), and the repo has <TreatWarningsAsErrors>true</TreatWarningsAsErrors> in Directory.Build.props.

The affected projects include Microsoft.Identity.Web.csproj and Microsoft.Identity.Web.TokenCache.csproj, which fail NuGet restore for all three target frameworks (net8.0, net9.0, net10.0).

Root Cause

The runtime version variables and package versions in Directory.Build.props reference vulnerable versions of System.Security.Cryptography.Xml:

  • net8.0: SystemSecurityCryptographyXmlVersion = 8.0.1 (vulnerable, patched in 8.0.3)
  • net9.0: NetNineRuntimeVersion = 9.0.0 → all runtime packages including System.Security.Cryptography.Xml resolve to 9.0.0 (vulnerable, patched in 9.0.15)
  • net10.0: NetTenRuntimeVersion = 10.0.0 → all runtime packages including System.Security.Cryptography.Xml resolve to 10.0.0 (vulnerable, patched in 10.0.6)

Required Fix

Update the following in Directory.Build.props:

  1. Line 101 (NetNineRuntimeVersion): Change from 9.0.0 to 9.0.15
  2. Line 102 (AspNetCoreNineRuntimeVersion): Update to the corresponding ASP.NET Core 9 servicing release that aligns with .NET 9.0.15 (should be 9.0.15 as well)
  3. Line 118 (NetTenRuntimeVersion): Change from 10.0.0 to 10.0.6
  4. Line 119 (AspNetCoreTenRuntimeVersion): Update to the corresponding ASP.NET Core 10 servicing release that aligns with .NET 10.0.6 (should be 10.0.6 as well)
  5. Line 141 (SystemSecurityCryptographyXmlVersion under the net8.0 condition): Change from 8.0.1 to 8.0.3

This bumps the full runtime dependency set to patched servicing releases, ensuring consistency across all runtime-derived packages and not just silencing the one audit warning.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Restored D:\a\microsoft-identity-web\microsoft-identity-web\tests\PerformanceTests\PerformanceTestService\PerformanceTestService.csproj (in 6.8 sec).
Restored D:\a\microsoft-identity-web\microsoft-identity-web\tests\DevApps\AspireBlazorCallsWebApi\AspireBlazorCallsWebApi.Web\AspireBlazorCallsWebApi.Web.csproj (in 9.73 sec).
Restored D:\a\microsoft-identity-web\microsoft-identity-web\tests\DevApps\AspireBlazorCallsWebApi\AspireBlazorCallsWebApi.ServiceDefaults\AspireBlazorCallsWebApi.ServiceDefaults.csproj (in 8.11 sec).
Restored D:\a\microsoft-identity-web\microsoft-identity-web\tests\DevApps\AspireBlazorCallsWebApi\AspireBlazorCallsWebApi.ApiService\AspireBlazorCallsWebApi.ApiService.csproj (in 3.48 sec).
Restored D:\a\microsoft-identity-web\microsoft-identity-web\src\Microsoft.Identity.Web.UI\Microsoft.Identity.Web.UI.csproj (in 1.13 sec).
D:\a\microsoft-identity-web\microsoft-identity-web\src\Microsoft.Identity.Web\Microsoft.Identity.Web.csproj : error NU1901: Warning As Error: Package 'System.Security.Cryptography.Xml' 8.0.1 has a known low severity vulnerability, GHSA-37gx-xxp4-5rgx [D:\a\microsoft-identity-web\microsoft-identity-web\Microsoft.Identity.Web.sln]
D:\a\microsoft-identity-web\microsoft-identity-web\src\Microsoft.Identity.Web\Microsoft.Identity.Web.csproj : error NU1901: Warning As Error: Package 'System.Security.Cryptography.Xml' 8.0.1 has a known low severity vulnerability, GHSA-w3x6-4m5h-cxqf [D:\a\microsoft-identity-web\microsoft-identity-web\Microsoft.Identity.Web.sln]
D:\a\microsoft-identity-web\microsoft-identity-web\src\Microsoft.Identity.Web\Microsoft.Identity.Web.csproj : error NU1901: Warning As Error: Package 'System.Security.Cryptography.Xml' 9.0.0 has a known low severity vulnerability, GHSA-37gx-xxp4-5rgx [D:\a\microsoft-identity-web\microsoft-identity-web\Microsoft.Identity.Web.sln]
D:\a\microsoft-identity-web\microsoft-identity-web\src\Microsoft.Identity.Web\Microsoft.Identity.Web.csproj : error NU1901: Warning As Error: Package 'System.Security.Cryptography.Xml' 9.0.0 has a known low severity vulnerability, GHSA-w3x6-4m5h-cxqf [D:\a\microsoft-identity-web\microsoft-identity-web\Microsoft.Identity.Web.sln]
D:\a\microsoft-identity-web\microsoft-identity-web\src\Microsoft.Identity.Web\Microsoft.Identity.Web.csproj : error NU1901: Warning As Error: Package 'System.Security.Cryptography.Xml' 10.0.0 has a known low severity vulnerability, GHSA-37gx-xxp4-5rgx [D:\a\microsoft-identity-web\microsoft-identity-web\Microsoft.Identity.Web.sln]
D:\a\microsoft-identity-web\microsoft-identity-web\src\Microsoft.Identity.Web\Microsoft.Identity.Web.csproj : error NU1901: Warning As Error: Package 'System.Security.Cryptography.Xml'...

This pull request was created from Copilot chat.

Copilot AI changed the title [WIP] Fix NU1901 errors due to vulnerable System.Security.Cryptography.Xml Bump net8/net9/net10 runtime package baselines to patched crypto servicing versions Apr 15, 2026
Copilot AI requested a review from gladjohn April 15, 2026 22:06
@gladjohn gladjohn marked this pull request as ready for review April 15, 2026 22:08
@gladjohn gladjohn requested a review from a team as a code owner April 15, 2026 22:08
Copy link
Copy Markdown
Member

@bgavrilMS bgavrilMS left a comment

Choose a reason for hiding this comment

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

Only the affected package needs to be bumped. Bumping Microsoft.Extensions.* packages can introduce breaking changes to consumers. We can do it if needed, but this doesn't seem to be the case.

Comment thread Directory.Build.props Outdated
Copy link
Copy Markdown
Member

@bgavrilMS bgavrilMS left a comment

Choose a reason for hiding this comment

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

Upgrade only the affected package. Don't mass upgrade Extensions etc. as it will cause breaking changes to users.

@gladjohn gladjohn force-pushed the copilot/fix-nuget-restore-errors branch 2 times, most recently from 36e9541 to 042ab29 Compare April 16, 2026 13:30
Upgrade only the affected crypto packages to patched versions:
- net8.0: SystemSecurityCryptographyXml 8.0.1->8.0.3, Pkcs 8.0.0->8.0.1
- net9.0: SystemSecurityCryptographyXml 9.0.0->9.0.15, Pkcs 9.0.0->9.0.15
- net10.0: SystemSecurityCryptographyXml 10.0.0->10.0.6, Pkcs 10.0.0->10.0.6

Pkcs is bumped alongside Xml because Xml depends on Pkcs >= same version
(otherwise NU1605 downgrade errors occur).

Sidecar: Remove JwtBearer/OpenIdConnect version overrides that conflicted
with the root Directory.Build.props, keeping OpenApi pinned at 9.0.9.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@gladjohn gladjohn force-pushed the copilot/fix-nuget-restore-errors branch from 042ab29 to 6a5707f Compare April 16, 2026 13:36
github-actions Bot pushed a commit to EelcoLos/nx-tinkering that referenced this pull request Apr 21, 2026
Pinned
[Microsoft.Identity.Web](https://github.com/AzureAD/microsoft-identity-web)
at 4.8.0.

<details>
<summary>Release notes</summary>

_Sourced from [Microsoft.Identity.Web's
releases](https://github.com/AzureAD/microsoft-identity-web/releases)._

## 4.8.0

## What's Changed
* Bump flatted from 3.3.3 to 3.4.2 in
/tests/DevApps/SidecarAdapter/typescript by @​dependabot[bot] in
AzureAD/microsoft-identity-web#3753
* Update changelog.md for ID.Web 4.6.0 by @​bgavrilMS in
AzureAD/microsoft-identity-web#3756
* Add token binding to MicrosoftIdentityMessageHandler by @​cpp11nullptr
in AzureAD/microsoft-identity-web#3743
* Bump picomatch in /tests/DevApps/SidecarAdapter/typescript by
@​dependabot[bot] in
AzureAD/microsoft-identity-web#3759
* Documentation: Clarify managed identity credential types for
containerized vs. VM/App Service deployments by @​Copilot in
AzureAD/microsoft-identity-web#3585
* Bump path-to-regexp from 8.3.0 to 8.4.0 in
/tests/DevApps/SidecarAdapter/typescript by @​dependabot[bot] in
AzureAD/microsoft-identity-web#3762
* Upgrade Microsoft Application Insights packages by @​RojaEnnam in
AzureAD/microsoft-identity-web#3763
* Use Abstractions 12 by @​pmaytak in
AzureAD/microsoft-identity-web#3761
* Post-4.7.0 by @​pmaytak in
AzureAD/microsoft-identity-web#3768
* Fix Comp Gov DOTNET-Security-10.0 by @​reginayap8 in
AzureAD/microsoft-identity-web#3769
* Upgrade CodeQL to V4: Fix 10 CodeQL Analysis Warnings and Errors by
@​reginayap8 in
AzureAD/microsoft-identity-web#3770
* fix warnings by @​gladjohn in
AzureAD/microsoft-identity-web#3771
* adding examples for using postgres as a distributed cache by
@​JaredMSFT in
AzureAD/microsoft-identity-web#3766
* Suppress AOT configuration-binding SYSLIB warnings in AotCompatibility
test app by @​Copilot in
AzureAD/microsoft-identity-web#3774
* Bump vite from 7.1.11 to 7.3.2 in
/tests/DevApps/SidecarAdapter/typescript by @​dependabot[bot] in
AzureAD/microsoft-identity-web#3772
* Skip legacy B2C local-account Todo UI test in WebAppUiTests by
@​Copilot in AzureAD/microsoft-identity-web#3778
* Fix initialization of ConfidentialClientApplicationOptions in
MergedOptions by @​cpp11nullptr in
AzureAD/microsoft-identity-web#3760
* Bump net8/net9/net10 runtime package baselines to patched crypto
servicing versions by @​Copilot in
AzureAD/microsoft-identity-web#3779
* Fix flaky certificate test failures on CI by @​gladjohn in
AzureAD/microsoft-identity-web#3780
* MTLS Without Tokens Support by @​tlupes in
AzureAD/microsoft-identity-web#3747
* Fix CredentialsProvider DI lifetime mismatch causing startup crash in
Development by @​Avery-Dunn in
AzureAD/microsoft-identity-web#3783
* Remove unused DataProtection configuration from Sidecar by @​Copilot
in AzureAD/microsoft-identity-web#3776

## New Contributors
* @​RojaEnnam made their first contribution in
AzureAD/microsoft-identity-web#3763
* @​reginayap8 made their first contribution in
AzureAD/microsoft-identity-web#3769
* @​JaredMSFT made their first contribution in
AzureAD/microsoft-identity-web#3766

**Full Changelog**:
AzureAD/microsoft-identity-web@4.6.0...4.8.0

Commits viewable in [compare
view](AzureAD/microsoft-identity-web@4.7.0...4.8.0).
</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.

NuGet audit vulnerability (NU1901) from transitive System.Security.Cryptography.Xml 10.0.0 causes build failure with TreatWarningsAsErrors

4 participants