deps/vulnerability-scan/dotnet
Dependencies are scanned for known vulnerabilities
Implements deps/vulnerability-scan for dotnet.
| Severity | warning |
| Tiers | 1, 2 |
| Stacks | dotnet |
| Scope | each |
| Kind | outcome |
| Source | library v0.5.0 |
| Selected by | fleetlint-recommended@v0.5.0 |
Requirement
A task-runner recipe or a CI step runs dotnet list package --vulnerable (or dotnet package list --vulnerable), or restore-time NuGet audit fails the build (TreatWarningsAsErrors, or NU1901-NU1904 in WarningsAsErrors, with NuGetAudit not switched off); or a stack-neutral scanner runs.
Why
A lockfile pins yesterday’s versions; only a scan says which of them are known to be exploitable today.
Parameters
runners:[../Makefile ../justfile ../Justfile ../Taskfile.yml ../Taskfile.yaml ../../Makefile ../../justfile ../../Justfile ../../Taskfile.yml ../../Taskfile.yaml ../../../Makefile ../../../justfile ../../../Justfile ../../../Taskfile.yml ../../../Taskfile.yaml]skip:^\s*[@+-]*\s*(\{\{[^}]*\}\}\s*|\$[({][A-Za-z_]+[)}]\s*)?(#|//|echo\b|printf\b|(sudo\s+)?(go (install|get)|cargo b?install|pipx? install|pip3 install|python3? -m pip install|uv (tool |pip )?(install|add)|(npm|pnpm|yarn|bun) (i|install|add|global add)|gem install|bundle add|brew install|dotnet tool (install|update)|composer (global )?require|apt(-get)? install|curl|wget)\b[^;&]*$)
Fix
Keep NuGet audit on and treat its warnings as errors in Directory.Build.props, or run dotnet list package --vulnerable --include-transitive in the audit target.
Agent instruction: Add the stack’s vulnerability scanner to the audit target of the task runner; use osv-scanner against the lockfile when the stack has no native tool. Do not fix the findings in the same change; list them.
A finding of this rule points at the file taskrunner.file != "" ? taskrunner.file : "Makefile" yields.
Sources
- https://csrc.nist.gov/pubs/sp/800/218/final (standard, PW.4.4: Verify that acquired commercial, open-source, and all other third-party software components comply with the requirements)
- https://github.com/ossf/scorecard/blob/main/docs/checks.md (standard, Vulnerabilities)
- https://fleetlint.org/baseline/#dependencies
- https://learn.microsoft.com/en-us/nuget/concepts/auditing-packages (spec)
- https://fleetlint.org/stacks/#net
Generated by fleetlint docs from catalog v0.5.0.