Skip to content

Commit 43a44f9

Browse files
authored
Document .NET 10 breaking change: SHA-1 fingerprint deprecation in dotnet nuget sign (#47922)
1 parent 11d4e80 commit 43a44f9

File tree

4 files changed

+60
-10
lines changed

4 files changed

+60
-10
lines changed

docs/core/compatibility/10.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ If you're migrating an app to .NET 10, the breaking changes listed here might af
103103
| [Default workload configuration from 'loose manifests' to 'workload sets' mode](sdk/10.0/default-workload-config.md) | Behavioral change | Preview 2 |
104104
| [`dotnet package list` performs restore](sdk/10.0/dotnet-package-list-restore.md) | Behavioral change | Preview 4 |
105105
| [`dotnet restore` audits transitive packages](sdk/10.0/nugetaudit-transitive-packages.md) | Behavioral change | Preview 3 |
106+
| [SHA-1 fingerprint support deprecated in `dotnet nuget sign`](sdk/10.0/dotnet-nuget-sign-sha1-deprecated.md) | Behavioral change | Preview 1 |
106107
| [MSBUILDCUSTOMBUILDEVENTWARNING escape hatch removed](sdk/10.0/custom-build-event-warning.md) | Behavioral change | Preview 1 |
107108
| [MSBuild custom culture resource handling](sdk/10.0/msbuild-custom-culture.md) | Behavioral change | Preview 1 |
108109
| [NU1510 is raised for direct references pruned by NuGet](sdk/10.0/nu1510-pruned-references.md) | Source incompatible | Preview 1 |
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: "Breaking change - SHA-1 fingerprint support deprecated in dotnet nuget sign"
3+
description: "Learn about the breaking change in .NET 10 where SHA-1 fingerprint support is deprecated in dotnet nuget sign command, promoting NU3043 warning to error."
4+
ms.date: 08/11/2025
5+
ai-usage: ai-assisted
6+
ms.custom: https://github.com/dotnet/docs/issues/47449
7+
---
8+
9+
# SHA-1 fingerprint support deprecated in `dotnet nuget sign`
10+
11+
Starting in .NET 10, the [NU3043](/nuget/reference/errors-and-warnings/nu3043) warning is promoted to an error when using SHA-1 fingerprints with the [`dotnet nuget sign` command](../../../tools/dotnet-nuget-sign.md). This change enforces the use of only strong, approved hash algorithms (SHA-2 family) for signing operations.
12+
13+
## Version introduced
14+
15+
.NET 10 Preview 1
16+
17+
## Previous behavior
18+
19+
In .NET 9 SDK, the `dotnet nuget sign` command accepted certificate fingerprints using SHA-1 and SHA-2 family algorithms (SHA256, SHA384, SHA512). If a SHA-1 fingerprint was used, a warning (NU3043) was issued, indicating the use of an insecure hashing algorithm, but the operation continued successfully.
20+
21+
## New behavior
22+
23+
Starting in .NET 10, the NU3043 warning is elevated to an error. This change blocks the use of SHA-1 fingerprints with the `--certificate-fingerprint` option in the `dotnet nuget sign` command, improving overall signing security.
24+
25+
## Type of breaking change
26+
27+
This is a [behavioral change](../../categories.md#behavioral-change).
28+
29+
## Reason for change
30+
31+
This change was made to enforce stronger security standards by disallowing the use of SHA-1 for certificate fingerprinting. SHA-1 is considered cryptographically weak and vulnerable to collision attacks.
32+
33+
## Recommended action
34+
35+
Update the usage of `dotnet nuget sign` to use fingerprints from the SHA-2 family only:
36+
37+
- SHA256 (recommended)
38+
- SHA384
39+
- SHA512
40+
41+
## Affected APIs
42+
43+
None.
44+
45+
## See also
46+
47+
- [dotnet nuget sign](../../../tools/dotnet-nuget-sign.md)
48+
- [NuGet warning NU3043](/nuget/reference/errors-and-warnings/nu3043)

docs/core/compatibility/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,8 @@ items:
468468
href: sdk/8.0/rid-graph.md
469469
- name: Setting DebugSymbols to false disables PDB generation
470470
href: sdk/8.0/debugsymbols.md
471+
- name: "SHA-1 fingerprint support deprecated in 'dotnet nuget sign'"
472+
href: sdk/10.0/dotnet-nuget-sign-sha1-deprecated.md
471473
- name: Source Link included in the .NET SDK
472474
href: sdk/8.0/source-link.md
473475
- name: Trimming can't be used with .NET Standard or .NET Framework

docs/core/tools/dotnet-nuget-sign.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: dotnet nuget sign command
33
description: The dotnet nuget sign command signs all the packages matching the first argument with a certificate.
44
author: heng-liu
5-
ms.date: 07/07/2021
5+
ms.date: 08/11/2025
66
---
77
# dotnet nuget sign
88

@@ -36,8 +36,8 @@ dotnet nuget sign -h|--help
3636

3737
The `dotnet nuget sign` command signs all the packages matching the first argument with a certificate. The certificate with the private key can be obtained from a file or from a certificate installed in a certificate store by providing a subject name or a SHA-1 fingerprint.
3838

39-
> [!NOTE]
40-
> This command requires a certificate root store that is valid for both code signing and timestamping. Also, this command may not be supported on some combinations of operating system and .NET SDK. For more information, see [NuGet signed package verification](nuget-signed-package-verification.md).
39+
> [!NOTE]
40+
> This command requires a certificate root store that's valid for both code signing and timestamping. Also, this command might not be supported on some combinations of operating system and .NET SDK. For more information, see [NuGet signed package verification](nuget-signed-package-verification.md).
4141
4242
## Arguments
4343

@@ -73,10 +73,9 @@ The `dotnet nuget sign` command signs all the packages matching the first argume
7373

7474
Specifies the fingerprint of the certificate used to search a local certificate store for the certificate.
7575

76-
Starting with .NET 9, this option can be used to specify the SHA-1, SHA-256, SHA-384, or SHA-512 fingerprint of the certificate.
77-
However, a `NU3043` warning is raised when a SHA-1 certificate fingerprint is used because it is no longer considered secure.
76+
Starting with .NET 9, this option can be used to specify the SHA-1, SHA-256, SHA-384, or SHA-512 fingerprint of the certificate. However, a `NU3043` warning is raised when a SHA-1 certificate fingerprint is used because it's no longer considered secure. In .NET 10 and later versions, [the warning is elevated to an error](../compatibility/sdk/10.0/dotnet-nuget-sign-sha1-deprecated.md). Only SHA-2 family fingerprints (SHA-256, SHA-384, and SHA-512) are supported.
7877

79-
All the previous versions of the .NET SDK continue to accept only SHA-1 certificate fingerprint.
78+
All pre-.NET 9 versions of the .NET SDK continue to accept only SHA-1 certificate fingerprint.
8079

8180
- **`--certificate-password <PASSWORD>`**
8281

@@ -123,10 +122,10 @@ The `dotnet nuget sign` command signs all the packages matching the first argume
123122
dotnet nuget sign foo.nupkg --certificate-path cert.pfx --certificate-password password
124123
```
125124

126-
- Sign *foo.nupkg* with certificate (password protected) matches with the specified SHA-1 fingerprint in the default certificate store (CurrentUser\My):
125+
- Sign *foo.nupkg* with certificate (password protected) matches with the specified SHA-256 fingerprint in the default certificate store (CurrentUser\My):
127126

128127
```dotnetcli
129-
dotnet nuget sign foo.nupkg --certificate-fingerprint 89967D1DD995010B6C66AE24FF8E66885E6E03A8 --certificate-password password
128+
dotnet nuget sign foo.nupkg --certificate-fingerprint B2C40F2F8775D7B7EBEB76BD5A9D3A4BC3F4B8A4D8D7C5F8A4C6B3E7A9E2D5F1 --certificate-password password
130129
```
131130

132131
- Sign *foo.nupkg* with certificate (password protected) matches with the specified subject name :::no-loc text="\"Test certificate for testing signing\""::: in the default certificate store (CurrentUser\My):
@@ -135,10 +134,10 @@ The `dotnet nuget sign` command signs all the packages matching the first argume
135134
dotnet nuget sign foo.nupkg --certificate-subject-name "Test certificate for testing signing" --certificate-password password
136135
```
137136

138-
- Sign *foo.nupkg* with certificate (password protected) matches with the specified SHA-1 fingerprint in the certificate store CurrentUser\Root:
137+
- Sign *foo.nupkg* with certificate (password protected) matches with the specified SHA-256 fingerprint in the certificate store CurrentUser\Root:
139138

140139
```dotnetcli
141-
dotnet nuget sign foo.nupkg --certificate-fingerprint 89967D1DD995010B6C66AE24FF8E66885E6E03A8 --certificate-password password --certificate-store-location CurrentUser --certificate-store-name Root
140+
dotnet nuget sign foo.nupkg --certificate-fingerprint B2C40F2F8775D7B7EBEB76BD5A9D3A4BC3F4B8A4D8D7C5F8A4C6B3E7A9E2D5F1 --certificate-password password --certificate-store-location CurrentUser --certificate-store-name Root
142141
```
143142

144143
- Sign multiple NuGet packages - *foo.nupkg* and *all .nupkg files in the directory specified* with certificate *cert.pfx* (not password protected):

0 commit comments

Comments
 (0)