-
Notifications
You must be signed in to change notification settings - Fork 605
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
Wrong CPEs generated for OpenSSL by dotnet cataloguer #3120
Comments
👋 thanks for the good repro steps @tomasr - when we get some cycles I think the best first step is to see if we can read more from that Currently we extract these fields:
syft/syft/pkg/cataloger/dotnet/parse_dotnet_portable_executable.go Lines 60 to 94 in cd3b828
How I see it is that, not specific to the nuget cataloger, but if ANY cataloger runs into a file with the Do you have an example of a vulnerability you think this SHOULD match against so we have a target cpe you think is correct to generate? |
Interestingly exiftool does show the metadata in that library, so it's in an 'easily' accessible location, if we wanted to grub around for it. "openssl" isn't there, as a specific entry.
|
Once I put the right CPEs in place (i.e. with just openssl), I get these from grype:
Which match what we've seen from other scanners. |
Awesome! Ok we talked about this during our livestream: I think what we're going to do here is move away from cpe generation for cataloger/packages here by trying to derive it from the metadata. Instead, the metadata here IS stable enough that we can build a key from it and then get pre-crafted correct cpes from our dictionary solution here: When we get some cycles someone from the team will pick it up and move us away from generating these junk CPE for packages coming form this cataloger. |
What happened:
Using Syft to scan a folder that contains a mix of .NET libraries as well as native windows libraries.
The native windows libraries include OpenSSL components (
libssl-3-x64.dll
andlibcrypto-3-x64.dll
).When scanning the libraries, the generated SBOM has output like this:
Notice the CPE
cpe:2.3:a:The_OpenSSL_Toolkit:The_OpenSSL_Toolkit:3.0.8:*:*:*:*:*:*:*
. Notice the name isThe_OpenSSL_Toolkit
which seems to be based on the Product Name field in the resources of the library:This will lead to other tools (like grype) being unable to actually match these to any known vulnerabilities.
What you expected to happen:
Using the right CPEs would let these be matched:
cpe:2.3:a:openssl:openssl:3.0.8:*:*:*:*:*:*:*
.Unfortunately, I'm not quite sure how you'd figure that out just from the library information available, but I suspect a more general class of this issue is that the dotnet cataloger sort of assumes everything is a .net assembly and not arbitrary native Windows libraries that could be present (and there doesn't seem to be any other cataloger available that would handle native windows binaries in general).
Steps to reproduce the issue:
Anything else we need to know?:
Environment:
syft version
: 1.11cat /etc/os-release
or similar): Windows 11The text was updated successfully, but these errors were encountered: