Safeguard
Developer Tools•

NuGet packages.config or PackageReference: which gets audited?

NuGet audits PackageReference and packages.config projects at different versions and modes. See what each covers and how to confirm every project ran.

Safeguard Security Team
3 min read

NuGet audits both formats, but not identically. Audit for PackageReference arrived in NuGet 6.8, and for packages.config in NuGet 6.10. The direct versus all mode setting does not apply to packages.config, and the default mode depends on your target framework.

What the documentation says

The NuGet auditing page gives this history: the vulnerable listing of dotnet list package from NuGet 5.9, NuGetAudit for PackageReference from 6.8, and NuGetAudit for packages.config from 6.10. Suppression support followed in 6.11 for PackageReference and 6.12 for packages.config.

NuGetAuditMode takes direct or all. The page says it is not applicable to packages.config projects. The default is all when a project targets net10.0 or higher, and direct otherwise. For a multi-targeting project, if any target selects all, audit uses all for every target.

The vulnerability data for nuget.org comes from the GitHub Advisory Database, and audit sources are set in NuGet.Config.

Where gaps appear

GapEffect
Older tooling than 6.8 or 6.10No audit warnings at all
Default mode is directVulnerable transitive packages are not reported
Audit source returns no dataWarning NU1905 is raised
Source unreachableWarning NU1900 is raised
Restore skipped for an up to date projectThat project may not be audited in that run

A quiet restore is not proof of a clean project. The documentation itself says no findings means none were found at the present moment, and advisory data can change at any time.

How to confirm everything was audited

  1. Check the SDK and NuGet versions on every build agent, not just developer machines.
  2. Set NuGetAuditMode to all where you can, and note that packages.config projects follow their own behavior.
  3. Treat NU1900 and NU1905 as signals that coverage failed, not as noise.
  4. Use the restore output properties described in the documentation, RestoreProjectCount and RestoreProjectsAuditedCount, to fail CI if a project was not audited. They are not available with static graph restore.
  5. Run the dotnet list package command with the vulnerable and include transitive options, because transitive packages are not included by default there.

Prefer a dedicated audit pipeline so new advisories do not block unrelated fixes at awkward times, as the documentation suggests.

See also dotnet central package management and vulnerability scans.

Safeguard's SBOM and dependency scanning gives one inventory across ecosystems, with a free scan at https://gold.safeguard.sh/scan.

Quick check

Does NuGetAuditMode work for packages.config?

No. The documentation says it is not applicable to packages.config projects.

What does warning NU1905 mean?

An audit source does not provide a vulnerability database, so that source could not be used to check packages.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.