You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today we have a binary classifier in syft that raises up packages for particular instances of java binaries. On the vulnerability side of this, there are some qualities in the data that are not addressed:
Sometimes you'll see vulnerabilities written against version 8 othertimes you'll see version 1.8.0.
The above issues lead to inconsistencies in matching. Take for example:
FROM alpine:latest as base
RUN apk add curl
RUN curl -o java.tar.gz https://cdn.azul.com/zulu/bin/zulu8.74.0.17-ca-jdk8.0.392-linux_x64.tar.gz
RUN tar -xzvf java.tar.gz
FROM scratch
COPY --from=base /zulu8.74.0.17-ca-jdk8.0.392-linux_x64/jre/bin/java /java
This is because there is a < 8 in the version constraint for all of these vulnerability records:
$ sqlite3 ./vulnerability.db 'SELECT id,namespace,package_name from vulnerability where package_name like "%jdk%" and namespace == "nvd:cpe" and version_constraint like "%< 8%" '
CVE-2023-21930|nvd:cpe|openjdk
CVE-2023-21937|nvd:cpe|openjdk
CVE-2023-21938|nvd:cpe|openjdk
CVE-2023-21939|nvd:cpe|openjdk
CVE-2023-21954|nvd:cpe|openjdk
CVE-2023-21967|nvd:cpe|openjdk
Say I had an SBOM where we had explictly a known bad version of openjdk:
$sqlite3 ./vulnerability.db 'SELECT id,namespace,package_name,version_constraint from vulnerability where package_name like "%jdk%" and namespace == "nvd:cpe" and version_constraint like "%= 1.8%" '
...
CVE-2022-21619|nvd:cpe|jdk|= 1.8.0-update341 || = 1.8.0-update345 || = 11.0.16.1 || = 17.0.4.1 || = 19
...
We wouldn't be able to match on it for a few reasons:
based on what syft raises up, we will never surface anything that looks like <semver>-update<number>. Note that these versions are found in the artifact as <semver>_u?<update>-<build>?.
we put in a package name of openjdk and not jdk
There are a few more entries in the DB for jdk than there are openjdk:
$ sqlite3 ./vulnerability.db 'SELECT id,namespace,package_name,version_constraint from vulnerability where package_name like "%openjdk%" and namespace == "nvd:cpe"' |
wc -l
99
$ sqlite3 ./vulnerability.db 'SELECT id,namespace,package_name,version_constraint from vulnerability where package_name like "%jdk%" and namespace == "nvd:cpe"' | wc -l
1302
This points to some tangible actions we could take:
in syft, start listing a CPE with jdk as well as openjdk
in vunnel, the NVD provider, change openjdk version constraints within node configurations to be based on the version number of the application and not the product number for all versions <9 (e.g. swap 8 update40 for 1.8 upadate 40)
update grype-db where we deal with placing update version info (e.g. -update40) to consider ecosystem specific changes when there are oracle:openjdk or oracle:jdk entires found. These should be written as _40 instead of -update40.
The text was updated successfully, but these errors were encountered:
The more I look at this I think the most sensible thing to do is to simply write a matcher in grype that takes these variables (both on the product name side and correct version conversion/comparison) into consideration.
Today we have a binary classifier in syft that raises up packages for particular instances of
java
binaries. On the vulnerability side of this, there are some qualities in the data that are not addressed:8
othertimes you'll see version1.8.0
.update231
,update_251
oracle:jdk
vsoracle:openjdk
These points are somewhat of a summary from other places:
The above issues lead to inconsistencies in matching. Take for example:
$ docker build -t localhost/jdk:latest . $ syft localhost/jdk:latest -o json
...or more specifically in the JSON output for
CVE-2023-21930
:This is because there is a
< 8
in the version constraint for all of these vulnerability records:Say I had an SBOM where we had explictly a known bad version of openjdk:
We wouldn't be able to match on it for a few reasons:
based on what syft raises up, we will never surface anything that looks like
<semver>-update<number>
. Note that these versions are found in the artifact as<semver>_u?<update>-<build>?
.we put in a package name of
openjdk
and notjdk
There are a few more entries in the DB for
jdk
than there areopenjdk
:This points to some tangible actions we could take:
jdk
as well asopenjdk
8 update40
for1.8 upadate 40
)-update40
) to consider ecosystem specific changes when there areoracle:openjdk
ororacle:jdk
entires found. These should be written as_40
instead of-update40
.The text was updated successfully, but these errors were encountered: