-
Notifications
You must be signed in to change notification settings - Fork 585
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
Failed to parse constraint of CVE-2024-6345 which fails the scan #2048
Comments
I'm having the same issue with Alpine 3.20.2 The same scan worked last week. One thing that sticks out to me was previously the Vulnerability field was not showing the GHSA instead of the CVE: NAME INSTALLED FIXED-IN TYPE VULNERABILITY SEVERITY And now it looks like the error is complaining about the CVE tied to the same vulnerability as the GHSA. Not sure if that's related, but it was the first time I a vulnerability show up as the GHSA. |
There are multiple things happening here, one being upstream data changing... but aside from that this kind of error should not be fatal (the user should be able to get a grype report even if the data is problematic/unexpected upstream). Today the vulnerability provider code can raise up errors when the constraint isn't parsed correctly grype/grype/db/vulnerability_provider.go Lines 88 to 91 in 4ec46b5
GetBy* methods should not return errors for these cases (unable to inflate vulnerability record from DB), instead we should be logging warnings. Though the user cannot take action to fix this, the state of the vuln data does affect the vuln report (potentially missing results) so we should let the user know without requiring debug.
|
Here is a link to the secfix that's causing the headache - it looks like this was merged a day ago which is an incorrect version constraint for alpine I'll try and get a PR submitted to fix this in the data, but I agree with @wagoodman's statement above as well that we should protect more against this. Change request filed: |
hi, thanks for the fast investigation! |
We'll put in a new release with the error handing in probably today (may even cut a release today), but it isn't clear when the upstream data will be addressed (thus this particular CVE will be omitted from grype results when this error processing fix lands). |
sounds perfect 👍 |
What happened:
I have an image based on alpine 3.20 and the scan fails. The error is:
unable to find matches in DB: provider failed to inflate vulnerability record (namespace="alpine:distro:alpine:3.20" id="CVE-2024-6345" distro="alpine 3.20.2"): failed to parse constraint='< 70.3.0-rc0' format='Apk': unable to parse apk constraint phrase: failed to create comparator for '&{< 70.3.0-rc0}': unable to parse constraint version (70.3.0-rc0): invalid version
What you expected to happen:
Scan should pass
How to reproduce it (as minimally and precisely as possible):
Here is a Dockerfile to reproduce:
Anything else we need to know?:
I checked on alpine 3.19 and it works.
might it be related to the phrase "rc" inside the constraint?
Environment:
grype version
: 0.79.5cat /etc/os-release
or similar): macThe text was updated successfully, but these errors were encountered: