Replies: 5 comments 7 replies
-
This is not really how it works that you just randomly go and replace some JARs without any testing and so on. The dependencies need to be fixed at source where they understand how they are used, can properly test the fix etc. |
Beta Was this translation helpful? Give feedback.
-
Yes, I understand how it works. Here is the dependency for current main branch: unfortunately, the newest version of released official version of jackson-dataformat-yaml is 2.14.2 [INFO] +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.14.2:compile and it the snakeyaml of version 1.33 doesn't meet the security requirement either. and we know that we can't swap snakeyaml:jar to version 2.0 because the API change. so the only solution seems to be have a fix of snakeyaml:jar in 1.x.x version with GHSA-mjmj-j48q-9wg2 fixed. |
Beta Was this translation helpful? Give feedback.
-
opened ticket FasterXML/jackson-dataformats-text#410 |
Beta Was this translation helpful? Give feedback.
-
opened request FasterXML/jackson-dataformats-text#410. once that is done, the new version of jackson-dataformat-yaml need to be used in the strimzi kafka operator and other strimzi repo to remove the dependency. |
Beta Was this translation helpful? Give feedback.
-
@scholzj , can you help to make this change in the main branch ? 2.15.0-rc2 is the newest version of jackson release right now I tried this in the pom.xml file and run < <fasterxml.jackson-core.version>2.14.2</fasterxml.jackson-core.version>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I did some trivy security scan (https://github.com/aquasecurity/trivy) with strimzi-kafka-operator image quay.io/strimzi/operator:0.34.0 , found these errors:
┌───────────────────────────────────────────────────────────┬───────────────┬──────────┬───────────────────┬───────────────┬──────────────────────────────────────────────────────────────┐
│ Library │ Vulnerability │ Severity │ Installed Version │ Fixed Version │ Title │
├───────────────────────────────────────────────────────────┼───────────────┼──────────┼───────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤
│ net.minidev:json-smart │ CVE-2023-1370 │ HIGH │ 2.4.7 │ 2.4.9 │ Json-smart is a │
│ (com.nimbusds.nimbus-jose-jwt-9.10.jar) │ │ │ │ │ performance f ... │
│ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2023-1370 │
├───────────────────────────────────────────────────────────┤ │ │ │ │ │
│ net.minidev:json-smart (net.minidev.json-smart-2.4.7.jar) │ │ │ │ │ │
│ │ │ │ │ │ │
│ │ │ │ │ │ │
├───────────────────────────────────────────────────────────┼───────────────┼──────────┼───────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤
│ org.yaml:snakeyaml (org.yaml.snakeyaml-1.33.jar) │ CVE-2022-1471 │ CRITICAL │ 1.33 │ 2.0 │ SnakeYaml: Constructor Deserialization Remote Code Execution │
│ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-1471 │
└───────────────────────────────────────────────────────────┴───────────────┴──────────┴───────────────────┴───────────────┴──────────────────────────────────────────────────────────────┘
basically com.nimbusds.nimbus-jose-jwt-9.10.jar need to be upgraded to
version https://repo1.maven.org/maven2/com/nimbusds/nimbus-jose-jwt/9.24.4/nimbus-jose-jwt-9.24.4.jar
net.minidev.json-smart-2.4.7.jar need to be upgraded to version
wget https://repo1.maven.org/maven2/net/minidev/json-smart/2.4.9/json-smart-2.4.9.jar
org.yaml.snakeyaml-1.33.jar need to upgrade to version
(https://repo1.maven.org/maven2/org/yaml/snakeyaml/2.0/snakeyaml-2.0.jar)
however, when I made the jar switch, I got this exception:
Exception in thread "main" java.lang.NoSuchMethodError: 'void org.yaml.snakeyaml.parser.ParserImpl.(org.yaml.snakeyaml.reader.StreamReader)'
at com.fasterxml.jackson.dataformat.yaml.YAMLParser.(YAMLParser.java:191)
at com.fasterxml.jackson.dataformat.yaml.YAMLFactory._createParser(YAMLFactory.java:509)
at com.fasterxml.jackson.dataformat.yaml.YAMLFactory.createParser(YAMLFactory.java:413)
at com.fasterxml.jackson.dataformat.yaml.YAMLFactory.createParser(YAMLFactory.java:15)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3698)
at io.strimzi.operator.cluster.model.KafkaVersion.parseKafkaVersions(KafkaVersion.java:48)
at io.strimzi.operator.cluster.model.KafkaVersion$Lookup.(KafkaVersion.java:113)
at io.strimzi.operator.cluster.model.KafkaVersion$Lookup.(KafkaVersion.java:100)
at io.strimzi.operator.cluster.ClusterOperatorConfig.parseKafkaVersions(ClusterOperatorConfig.java:457)
at io.strimzi.operator.cluster.ClusterOperatorConfig.fromMap(ClusterOperatorConfig.java:293)
at io.strimzi.operator.cluster.Main.main(Main.java:81)
it turns out, upgrade org.yaml.snakeyaml-1.33.jar to version 2.0 doesn't work because the internal API changed. I then tried all the versions listed in https://repo1.maven.org/maven2/org/yaml/snakeyaml/ , the problem is , snakeyaml version lower than 2.0 can not pass the scan, snakeyaml version 2.0 or above doesn't work because of the API change.
Can somebody help to upgrade the version for strimzi-kafka-operator ?
I also found similar issue for docker image quay.io/strimzi/kafka:0.34.0-kafka-3.3.2
and I end up have to download these
RUN wget https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.9/scala-library-2.13.9.jar
RUN wget https://repo1.maven.org/maven2/com/nimbusds/nimbus-jose-jwt/9.24.4/nimbus-jose-jwt-9.24.4.jar
RUN wget https://repo1.maven.org/maven2/net/minidev/json-smart/2.4.9/json-smart-2.4.9.jar
RUN wget https://repo1.maven.org/maven2/org/yaml/snakeyaml/2.0/snakeyaml-2.0.jar
RUN wget https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.18.0/jmx_prometheus_javaagent-0.18.0.jar
to replace the jar files inside the images
RUN /bin/rm -rf /opt/cruise-control/libs/scala-library-2.13.6.jar /opt/kafka/libs/scala-library-2.13.8.jar
RUN cp /download/scala-library-2.13.9.jar /opt/cruise-control/libs/
RUN cp /download/scala-library-2.13.9.jar /opt/kafka/libs/
RUN /bin/rm -rf /opt/cruise-control/libs/nimbus-jose-jwt-9.21.jar /opt/kafka/libs/nimbus-jose-jwt-9.10.jar
RUN cp /download/nimbus-jose-jwt-9.24.4.jar /opt/cruise-control/libs/
RUN cp /download/nimbus-jose-jwt-9.24.4.jar /opt/kafka/libs/
RUN /bin/rm -rf /opt/kafka/libs/json-smart-2.4.7.jar
RUN cp /download/json-smart-2.4.9.jar /opt/kafka/libs/
RUN /bin/rm -rf /opt/cruise-control/libs/snakeyaml-1.33.jar /opt/kafka/libs/snakeyaml-1.33.jar
RUN cp /download/snakeyaml-2.0.jar /opt/kafka/libs/
RUN cp /download/snakeyaml-2.0.jar /opt/cruise-control/libs/
RUN /bin/rm -rf /opt/kafka/libs/jmx_prometheus_javaagent-0.17.2.jar
RUN cp /download/jmx_prometheus_javaagent-0.18.0.jar /opt/kafka/libs/
so pass the security scan. luckily , this actually worked. Can we update the jar file version inside the pom file so we don't have to make this change manually ?
Beta Was this translation helpful? Give feedback.
All reactions