-
Notifications
You must be signed in to change notification settings - Fork 574
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
No vulnerabilities found for nuget package #1065
Comments
@florian-pahl-tm would you be able to provide us with the original source of the SBOM? It looks like grype is behaving correctly in this case - detecting vulnerabilities for:
By having the original source that the SBOM came from we can examine why Have you tried generating an SBOM of the same source with syft? Should a vulnerability be detected for |
@westonsteimel also got me up to speed - It looks like dotnet is not part of the PURL specification and favors nuget Let me give a look and see the list of changes we need to make to get that change in |
For reference here is the initial dotnet support and what I'm looking at: |
@spiffcs Here is the <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
</ItemGroup>
</Project> Syft does not detect any packages (I thing dotnet support is very basic here): syft .
✔ Indexed .
✔ Cataloged packages [0 packages]
No packages discovered |
Just for reference here is the purl spec: https://github.com/package-url/purl-spec/blob/master/PURL-TYPES.rst |
Hi @florian-pahl-tm, we believe this has been fixed in the latest version of Grype. Can you try and let us know if you run into the same results? Thanks much! |
Here is the fix: anchore/syft#1649 |
Tried with latest grype version 0.59.1. Still experiencing the same bug as outlined in first comment. |
Sorry @florian-pahl-tm, it's possible we misunderstood the problem. We will take another look and get back to you. |
Same here. How to reproduce it (as minimally and precisely as possible): Run grype on the following sbom created with
What you expected to happen:
What happened:
GHSA-5crp-9r3c-p9vr actually applies to the |
I can confirm the original poster's complaint: Even though the spec calls out "nuget" as the appropriate type (and the CycloneDx tool in NuGet properly formats the purl this way), grype appears to expect "dotnet" instead. Perhaps there are other SBOM-generating tools that improperly use "dotnet" as the purl type. Could grype be made to accommodate one as an alias for the other? |
I don't quite understand the SCM relationship between Grype and Syft. When will I know that a new Grype version has this fix? |
Sorry, I didn't mean to close this before the Syft bump in Grype was in. You'll see an item in the release notes, like in https://github.com/anchore/grype/releases/tag/v0.73.5, that mentions that the new Syft is incorporated in Grype. |
Thanks, @willmurphyscode ! |
This is fixed in the latest release of grype (v0.74.0), which pulls in a Syft version that includes anchore/syft#2466. |
What happened:
I scanned a sbom file produced by CycloneDX-dotnet. Grype did not detect any vulnerabilites, as the purls of the components do not match:
After replacing
nuget
withdotnet
in the purl, scanning worked as expected.What you expected to happen:
Grype detects one vulnerability for the provided sample:
How to reproduce it (as minimally and precisely as possible):
Scan the following sample file:
Anything else we need to know?:
Environment:
Output of
grype version
:Application: grype
Version: 0.55.0
Syft Version: v0.65.0
BuildDate: 2023-01-04T21:18:26Z
GitCommit: c559833
GitDescription: v0.55.0
Platform: darwin/amd64
GoVersion: go1.18.9
Compiler: gc
Supported DB Schema: 5
OS (e.g:
cat /etc/os-release
or similar): MacOSThe text was updated successfully, but these errors were encountered: