A 72-Hour Pause for New NuGet Packages: Useful Guardrail, Not a Security Guarantee
- Get link
- X
- Other Apps
A 72-Hour Pause for New NuGet Packages: Useful Guardrail, Not a Security Guarantee
Fresh package releases are useful, but they are also the moment when a bad release can spread fastest. .NET 11 and NuGet 8 add an opt-in minimum package publish age: a repository can tell NuGet to wait before automatically selecting a newly published version.
This is a small, practical control for teams that use automatic dependency updates. It is not a scanner, a signature check, or a replacement for reviewing a dependency. Think of it as a pause that creates time for a malicious or broken release to be noticed.
What the setting actually does
Set minPublishAgeHours on a package source in nuget.config. The following example makes versions from nuget.org eligible for automatic selection only after 72 hours:
<?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <clear /> <add key="nuget.org" value="https://api.nuget.org/v3/index.json" minPublishAgeHours="72" /> <add key="Company" value="https://packages.example.com/v3/index.json" /> </packageSources> <minPublishAgeExceptions /> </configuration>The setting is available with NuGet 8.0, .NET SDK 11.0.100, and Visual Studio 18.12. It uses whole hours. A source without the attribute, or with a value of 0, has no waiting period.
You can also configure a source from the CLI:
dotnet nuget add source https://api.nuget.org/v3/index.json \ --name nuget.org \ --min-publish-age-hours 72Commit the repository-level nuget.config so local development and CI start from the same policy. A higher-priority configuration can redefine a source; if it omits the attribute, that source's effective age returns to zero.
Know the boundary: selection, not every restore
The most important detail is that minimum publish age filters automatic version choices. dotnet package add and dotnet package update exclude versions that are too new when they choose a version for you. Explicitly requesting a version bypasses the age filter.
Ordinary restore does not reject a directly specified version merely because it was published recently. It also does not enforce the age for transitive packages in a normal, fixed-version dependency graph. Floating references such as 1.2.* are different: restore can fail with NU1020 when no eligible version satisfies the configured age.
This means the policy reduces the chance of automatically accepting a brand-new release; it does not prove that the version you eventually use is safe.
Use exceptions sparingly
Exceptions are package patterns that bypass the delay:
<minPublishAgeExceptions> <package pattern="Company.*" /> </minPublishAgeExceptions>Patterns are case-insensitive, and an exception applies to every version of every matching package. That makes an exception convenient for a trusted internal namespace, but broad exceptions also remove the pause for future releases. Keep the list small and review it like any other security-sensitive configuration.
Pair the pause with source mapping
A waiting period is weaker when the same package can be obtained from several feeds. NuGet's Package Source Mapping lets you state which source should provide each package pattern:
<packageSourceMapping> <packageSource key="nuget.org"> <package pattern="*" /> </packageSource> <packageSource key="Company"> <package pattern="Company.*" /> </packageSource> </packageSourceMapping>Source mapping improves determinism and helps reduce dependency-confusion risk, but it has an important limitation: current dotnet package add and package-list metadata lookups query configured sources broadly. Use mapping to constrain restore and update behavior, but do not assume it hides every package query from every source.
A practical policy for a repository
- Start with 72 hours for public feeds. It is a useful review window, not a universal correct number.
- Leave trusted internal feeds at zero only when that is intentional. Private packages still need normal review and access controls.
- Commit one root
nuget.config. Use<clear />when you need to prevent inherited sources from changing the policy. - Keep package versions pinned. The age setting is most useful when an automated command is choosing a new version; it is not a substitute for controlled version changes.
- Continue NuGet auditing. A delayed package can still contain a vulnerability, and a delayed security fix can create risk of its own.
The trade-off: time helps review, but time can delay a fix
NuGet's documentation explicitly warns that the policy can delay legitimate security updates. Even dotnet package update --vulnerable still respects the minimum age. If an urgent fix is needed, review the release and explicitly request its version rather than removing the repository-wide policy. A package exception is broader because it bypasses the delay for all versions of that package.
The right conclusion is modest: minimum publish age is a useful speed bump. It gives maintainers and the community time to notice a suspicious release, while source mapping makes feed selection more predictable and NuGet Audit helps find known vulnerabilities. Together these controls improve the supply chain; none of them turns dependency management into a zero-risk process.
References
- Minimum package publish age — configuration, selection behavior, restore limitations, and exceptions.
- dotnet nuget add source — CLI syntax and the
--min-publish-age-hoursoption. - Package Source Mapping — mapping package patterns to trusted sources and its scope.
- Best practices for a secure software supply chain — dependency, feed, and auditing guidance.
- What's new in the SDK and tooling for .NET 11 — the release context for the new package-source option.
❤️ Support This Blog
If this post helped you, you can support my writing with a small donation. Thank you for reading.
- Get link
- X
- Other Apps

Comments
Post a Comment