Recognize NuGet unlisted
packages and do not log 'error parsing upload time for NuGet component'
#2388
Open
2 tasks done
Labels
enhancement
New feature or request
Current Behavior
Using Dependency Track 4.7.0, warnings similar to those below are regularly observed in the logs:
This was reported in #537 but closed as an assumed defect with NuGet metadata.
The official NuGet docs describe at least one valid use case for the
1900-01-01
timestamp: unlisted packages, which are de-facto deprecated and should no longer be used.One concrete example to illustrate this: https://www.nuget.org/packages/Unity/5.7.4 -- note the warning:
Use the NuGet API to retrieve the package registration details (https://api.nuget.org/v3/registration5-semver1/unity/5.7.4.json) and note the
listed: false
andpublished: "1900-01-01T00:00:00+00:00"
values in the response:The NuGet docs at https://learn.microsoft.com/en-us/nuget/api/registration-base-url-resource include an explicit note for this behavior:
However, Dependency Track does not currently recognize this value and logs a warning.
Proposed Behavior
Update
NugetMetaAnalyzer
to accept a NuGet APIpublished
value of1900-01-01T00:00:00+00:00
as valid, and meant to represent unlisted packages whose use is discouraged.dependency-track/src/main/java/org/dependencytrack/tasks/repositories/NugetMetaAnalyzer.java
Lines 49 to 52 in 90437bd
Additionally, consider enhancing Dependency Track to flag use of unlisted NuGet packages with warnings, e.g. in its APIs or frontend UI.
It may be helpful to see in the UI, similar to the warning icons for packages which have a newer version available, that the package is unlisted / deprecated and should no longer be used.
Checklist
The text was updated successfully, but these errors were encountered: