Skip to content

transitive packages added by dotnet package update --vulnerable should be marked as such #14527

@zivkan

Description

@zivkan

NuGet Product(s) Affected

dotnet.exe

Current Behavior

The initial implementation of dotnet package update --vulnerable will add PackageReferences to the project to promote transitive packages to direct package references when the transitive package has a security advisory.

Desired Behavior

The PackageReference item added to the project should have some matadata to signal that it was added only to mitigate a security advisory. This will allow both people and automated tools to understand this context and remove the package reference when it's no longer needed.

The exact metadata name and value is open for suggestions. Please comment with yours. Some initial ideas:

audit="mitigate security advisory"
pinned="security"
resolution="audit"

Additional Context

Most developers don't want their projects to reference unnecessary packages. When updating the package that originally caused the transitive package to be included either removes the dependency, or upgrades it to a version that no longer has security advisories, then it is usually preferable to remove the package reference and let the restore graph sort it out automatically.

The first time I heard the idea to add metadata so that tooling could automatically clean it up later was suggested to me by one of the Dependabot developers. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions