jmx_exporter icon indicating copy to clipboard operation
jmx_exporter copied to clipboard

Trivy security scan failing for jmx_prometheus_javaagent-0.16.0.jar

Open mkothar2 opened this issue 4 years ago • 5 comments
trafficstars

jmx_prometheus_javaagent-0.16.0.jar

Total: 1 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 1, CRITICAL: 0)

+--------------------+------------------+----------+-------------------+---------------+ | LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION | +--------------------+------------------+----------+-------------------+---------------+ | org.yaml:snakeyaml | CVE-2017-18640 | HIGH | 1.23 | 1.26 | +--------------------+------------------+----------+-------------------+---------------+

mkothar2 avatar Jul 06 '21 04:07 mkothar2

This should not happen, as the whole purpose of the 0.16.0 release was to build a version with snakeyaml 1.29. I am not familiar with Trivy. Do you know why it concludes that snakeyaml 1.23 is in the JAR?

fstab avatar Jul 08 '21 20:07 fstab

The link jmx_prometheus_javaagent_java6-0.16.0.jar referenced in https://github.com/prometheus/jmx_exporter/releases/tag/parent-0.16.0 returns a 404.

Looking inside the supposed Java 7+ jar returns the following which is probably what Trivvy is looking at:

jmx_prometheus_javaagent-0.16.0 $ grep -r '1\.23' .
./META-INF/maven/io.prometheus.jmx/collector/pom.xml:      <version>1.23</version> <!-- required for the Java 6 release -->
./META-INF/maven/org.yaml/snakeyaml/pom.xml:    <version>1.23</version>
./META-INF/maven/org.yaml/snakeyaml/pom.xml:        <tag>snakeyaml-1.23</tag>
./META-INF/maven/org.yaml/snakeyaml/pom.properties:version=1.23

ross211 avatar Jul 12 '21 14:07 ross211

I removed the pom.xml from the binary and released 0.16.1.

For reference: The metadata in pom.xml wrongly points to 1.23. That version is in fact not included in the Java 7+ binary. However, the metadata makes Trivy assume that the old version is used, and that causes the CVE warning.

Thanks for creating this issue.

fstab avatar Jul 13 '21 22:07 fstab

I can confirm this has cleared the notice in trivy for me.

ross211 avatar Jul 14 '21 06:07 ross211

Since this has been resolved. I propose we should close this issue.

dhoard avatar Sep 20 '21 19:09 dhoard

Closing as resolved.

dhoard avatar Jun 24 '23 01:06 dhoard