[x] I've confirmed that a security advisory in data sources was correct.
Run Trivy with -f json that shows data sources and make sure that the security advisory is correct.
N.a. given I'm dealing with false negatives.
Description
I stumbled upon a few Maven CVEs where Trivy correctly identifies the vulnerable dependency coordinate and lists it in its SBOM but doesn't flag the CVE even though the Github Security Advisory lists it as vulnerable.
As far as I know, GHSA is a data source for Maven CVEs. Based on that, my expectation would be that if Trivy finds a Maven dependency that has an entry in the GHSA, it should appear in the scan report.
Those CVEs are also flagged in the same image by JFog's XRay, so I think they are actual false negatives.
Examples:
CVE-2022-3509 and CVE-2022-3510 (protobuf-java):
In the SBOM, Trivy detects pkg:maven/com.google.protobuf/protobuf-java@3.7.1.
Vulnerable version range for both CVEs is < 3.16.3 (ghsa-1, ghsa-2).
Note that Trivy correctly flags CVE-2022-3171 for that same protobuf-java@3.7.1 package.
CVE-2022-1471 (snakeyaml):
In the SBOM, Trivy detects pkg:maven/org.yaml/snakeyaml@1.33.
Checklist
-f json
that shows data sources and make sure that the security advisory is correct.Description
I stumbled upon a few Maven CVEs where Trivy correctly identifies the vulnerable dependency coordinate and lists it in its SBOM but doesn't flag the CVE even though the Github Security Advisory lists it as vulnerable.
As far as I know, GHSA is a data source for Maven CVEs. Based on that, my expectation would be that if Trivy finds a Maven dependency that has an entry in the GHSA, it should appear in the scan report.
Those CVEs are also flagged in the same image by JFog's XRay, so I think they are actual false negatives.
Examples:
CVE-2022-3509 and CVE-2022-3510 (protobuf-java):
pkg:maven/com.google.protobuf/protobuf-java@3.7.1
.< 3.16.3
(ghsa-1, ghsa-2).protobuf-java@3.7.1
package.CVE-2022-1471 (snakeyaml):
pkg:maven/org.yaml/snakeyaml@1.33
.<= 1.33
(ghsa).CVE-2021-31684 (json-smart):
pkg:maven/net.minidev/json-smart@1.3.2
.>= 1.3.0, < 1.3.3
(ghse)Output of
trivy -v
:Additional details:
I'm also using the trivy-java-db with the following
metadata.json
:For scanning my container image, I'm running the following command:
Note that I had these findings on internal images. Happy to provide more data if necessary (i.e. the redacted SBOM for a reproducer).