-
Notifications
You must be signed in to change notification settings - Fork 575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dotnet-Portable-Executable-Cataloger uses wrong component version for dotnet runtime libraries #3282
Comments
This is probably related to #2697. |
Hi, @AndreasAndoerfer -- Syft looks at a few different properties in the PE files to attempt to determine the package and version, but we have found that these fields are not used in a consistent manner across various projects. Perhaps you could shed some light on improvements? We have tests of some set of PE files and the code which attempts to determine the package and version available to review. |
Hi @kzantow, First of all I want to clarify my use case to make my points more plausible:
All statements below refer to this use case. My issues:First of all I do not think that the PE file analysis is a proper way to identify dotnet dependencies.
Quick & Dirty ... and not correct:It seems that the Product-Version fits better than the file version for latest runtime versions. (Just a intuition) A But this is not really correct:
For example System.Text.RegularExpressions: This is the nuget package with a vulnerability CVE-2019-0820 which is fixed in version V4.3.1. With .NET 8.0 the result using the product version would be With .NET 6.0 the result using the product version would be Both results are not correct because there exists no nuget package in this version and in the end the CVE would not match. And to dig a little bit deeper: Even if the nuget package System.Text.RegularExpressions in version 4.3.0 is installed it is not used! What really matters:In the CVE for the above vulnerability the package name is not part of the CPE at all. (e.g.: cpe:2.3:a:microsoft:.net_core:2.2:::::::*) That brings me back to my point that I have dependency to a runtime as a whole. If there is any issue with any of the runtime libraries I will update my runtime as a whole and not a single DLL. In my case to get a secure application I have to update the linux-musl-x64 but I think this SBOM entry is not provided by any of the Dotnet catalogers. Final thoughts:
Sorry for this long answer but I hope it helps with this issue. |
What happened:
When executing syft to analyse a docker image with a dotnet application it is generating component entries with the file version of the dll and not the assembly version.
This causes a wrong cpe.
In my example it is the .net 8.0 System.Security.Cryptography.Xml.dll
Output of syft:
The library is just one example. This problem exist for all runtime libraries because the file version does not match the assembly- / runtime-version!
What you expected to happen:
I would expect to have the same version displayed in nuget and in the *.deps.json file of the project:
*.deps.json:
Output of syft with dotnet-deps-cataloger:
Steps to reproduce the issue:
Anything else we need to know?:
Environment:
syft version
: 1.12.2cat /etc/os-release
or similar): alpine imageThe text was updated successfully, but these errors were encountered: