Repository navigation
Bump Jackson 2.15.1 to 2.18.12 and import jackson-bom - #16309
deepika-lalwani123 wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates and centralizes various dependency versions in the parent pom.xml, including upgrades for Jackson, Netty, Jetty, Logback, and Gson, and introduces BOM imports to better manage transitive dependencies. It also removes the quartz update check in AppFabricServiceRuntimeModule.java and cleans up unused properties in child modules. The reviewer feedback correctly identifies several redundant version declarations and property overrides in child pom.xml files (such as gson.version, logback, httpclient, and httpcore) that can now be safely removed since they are managed centrally by the parent POM.
| <okhttp.version>4.9.1</okhttp.version> | ||
| <!-- Needs to define the gson and guava versions to override the one from dependency management in cdap pom.xml --> | ||
| <gson.version>2.8.6</gson.version> | ||
| <gson.version>2.8.9</gson.version> |
| <okhttp.version>4.9.1</okhttp.version> | ||
| <!-- Needs to define the gson and guava versions to override the one from dependency management in cdap pom.xml --> | ||
| <gson.version>2.8.6</gson.version> | ||
| <gson.version>2.8.9</gson.version> |
| <groupId>ch.qos.logback</groupId> | ||
| <artifactId>logback-classic</artifactId> | ||
| <version>1.2.8</version> | ||
| <version>${logback.version}</version> |
| <groupId>ch.qos.logback</groupId> | ||
| <artifactId>logback-core</artifactId> | ||
| <version>1.2.8</version> | ||
| <version>${logback.version}</version> |
| <groupId>org.apache.httpcomponents</groupId> | ||
| <artifactId>httpclient</artifactId> | ||
| <version>4.5.2</version> | ||
| <version>${httpclient.version}</version> |
| <groupId>org.apache.httpcomponents</groupId> | ||
| <artifactId>httpcore</artifactId> | ||
| <version>4.4.4</version> | ||
| <version>${httpcore.version}</version> |
| <groupId>org.apache.httpcomponents</groupId> | ||
| <artifactId>httpclient</artifactId> | ||
| <version>4.5.2</version> | ||
| <version>${httpclient.version}</version> |
| <groupId>org.apache.httpcomponents</groupId> | ||
| <artifactId>httpcore</artifactId> | ||
| <version>4.4.4</version> | ||
| <version>${httpcore.version}</version> |
cdap-data-streams3_2.12 was the only system-artifact module still on maven-bundle-plugin 3.3.0. cdap-data-pipeline3_2.12, cdap-etl-batch and cdap-program-report already use 3.5.0. The bnd in 3.3.0 can't parse the root-level module-info.class shipped in gson 2.8.9 and jackson-annotations 2.18.12 (the CVE bumps in this stack). Packaging fails with "Invalid class file module-info.class (java.lang.ArrayIndexOutOfBoundsException: 19)", and cdap-master -Pdist can't produce the data-streams system artifact. 3.5.0 handles it. Checked locally (JDK 8): - On develop, the data-streams bundle built with 3.3.0 and with 3.5.0 is the same: same 28 embedded jars, same Export-Package and Import-Package, same Require-Capability. - On this stack, packaging fails with 3.3.0 and succeeds with 3.5.0. The only bundle differences from develop are the intended version bumps (gson 2.8.9, logback 1.2.13). maven-bundle-plugin 5.1.9 was also tried. It builds, but changes what gets embedded: 11 to 17 extra jars per bundle, including cdap-api-common, cdap-runtime-spi, scala-library, jetty 9.4.51 and jackson 2.15.1. So it was not used here.
Root pom.xml: - jgit 5.9.0.202009080501-r -> 5.13.5.202508271544-r (stays on 5.x; 6.x needs Java 11). 5.13.4.202507202350-r fixes the same CVEs but was built on JDK 17 without --release 8: it calls the Java 9+ ByteBuffer.mark() overload and fails on Java 8 with NoSuchMethodError (all RepositoryManagerTest cases fail). 5.13.5 is the 5.13.4 fix release for this. - gson.version 2.3.1 -> 2.8.9. - log4j2.slf4j.version (log4j-to-slf4j / log4j-api) 2.20.0 -> 2.25.5. - commons-lang3 3.12.0 -> 3.18.0 (must precede commons-configuration2 2.15.0 in CL-07). cdap-master/pom.xml: remove the commons-io 2.12.0 override in the k8s profile so master/lib uses the managed commons-io 2.15.1. The quartz 2.3.2 bump needs a code change, so it is in the next commit (vuln/cl-09b-code) together with that change; every commit builds. Why: CVE fixes from image scanning of gcr.io/cdapio/cdap. Closes jgit b/578567823 (High) and b/578495338 (Medium). Platform side of log4j-api b/578584043 and commons-io b/578659719. Risk: low to medium. gson is used in many modules and is visible to plugins. Testing: JDK 8, Checkstyle on: cdap-source-control (all tests), cdap-proto (all tests), cdap-common LocationsTest, cdap-app-fabric compile and TimeSchedulerTest; mvn dependency:tree for the bumped artifacts.
Versions: - jackson.version 2.15.1 -> 2.18.12 (jackson-core, jackson-databind, jackson-annotations, jackson-dataformat-cbor, jackson-module-scala_2.12) - jackson-jaxrs-json-provider, jackson-jaxrs-base and jackson-module-jaxb-annotations 2.12.7 -> 2.18.12. These come from hadoop-yarn-common and were not managed; importing com.fasterxml.jackson:jackson-bom after the explicit entries aligns them with databind. Why: image scanning of gcr.io/cdapio/cdap reports Jackson CVEs. 2.18.12 is the minimum version that fixes all of them and runs on Java 8. Bugs: closes b/578521062 and b/578660123; part of the shared Jackson bug set (with CL-04 and CL-10). Merge gate (paired with the SnakeYAML 2.0 commit stacked directly on this one): this commit moves jackson-dataformat-yaml in master/lib (from elasticsearch-x-content) from 2.8.11 to 2.18.12. 2.18.12 needs SnakeYAML 1.33 or later, and master/lib has 1.17 until the next commit; the old 2.8.11 does not work with SnakeYAML 2.0. So the two commits must merge in the same push (one PR with two commits), also on release/6.11. Risk: medium-low. CDAP src/main does not import Jackson (CDAP uses Gson). Users are libraries: AWS SDK (emr), avro (program-report), Hadoop YARN, google-cloud-storage (dataproc), google-http-client (cloudkms). Spark programs keep using Spark's own Jackson. Testing (JDK 8, Checkstyle on): cdap-runtime-ext-emr, cdap-runtime-ext-dataproc, cdap-securestore-ext-cloudkms mvn package pass; ReportGenerationAppTest, cdap-spark-core3_2.12 (43 tests), DataPipelineTest Spark methods on cdap-data-pipeline3_2.12 and Spark2Test on cdap-unit-test-spark3_2.12 pass, except testPySpark, which fails because the local Python 3.13 cannot import pyspark 3.3 (typing.io was removed); unrelated to Jackson. dependency:tree shows every com.fasterxml.jackson artifact at 2.18.12.
c15d5e6 to
9e3818e
Compare
| <groupId>org.apache.felix</groupId> | ||
| <artifactId>maven-bundle-plugin</artifactId> | ||
| <version>3.3.0</version> | ||
| <version>3.5.0</version> |
There was a problem hiding this comment.
Can the latest 3.x version - 3.5.1 be used instead?
| <junit.version>4.11</junit.version> | ||
| <hamcrest.version>2.2</hamcrest.version> | ||
| <log4j2.slf4j.version>2.20.0</log4j2.slf4j.version> | ||
| <log4j2.slf4j.version>2.25.5</log4j2.slf4j.version> |
There was a problem hiding this comment.
Can 2.26.1 be used instead as it have additional vuln fixes?
Bump Jackson 2.15.1 to 2.18.12 and import jackson-bom
Stacked on #16308 (retarget to
developafter the earlier PRs merge).What changes
Root
pom.xmlonly:jackson.version(core, databind, annotations, dataformat-cbor, module-scala_2.12)com.fasterxml.jackson:jackson-bomimport)The
jackson-bomimport sits after the explicit Jackson entries, so the explicit entries still win and the BOM only fills in the modules that were not managed. Without it, the jaxrs / jaxb 2.12.7 modules would run on databind 2.18.Why
Image scanning of
gcr.io/cdapio/cdapreports Jackson CVEs. 2.18.12 is the minimum that fixes them all (it also fixes a newer Critical, which is why it is above the 2.18.x floor). All jars are Java 8.Findings
Stack order
This PR now sits below the SnakeYAML 2.0 / client-java 17 PR (#16310), which is stacked on it. It moves jackson-dataformat-yaml in
master/lib(from elasticsearch-x-content) from 2.8.11 to 2.18.12, which works with SnakeYAML 2.0. Merge gate (paired PRs): 2.18.12 needs SnakeYAML 1.33 or later, andmaster/libhas SnakeYAML 1.17 (from elasticsearch-x-content) until the SnakeYAML PR; the old 2.8.11 does not work with SnakeYAML 2.0. So this PR and the SnakeYAML PR must merge in the same push (or as one PR with two commits), and the release/6.11 cherry-picks must keep them together, the same rule as the quartz pair.Risk
Medium-low. CDAP
src/mainhas no Jackson imports; CDAP serializes with Gson. Jackson users are libraries: AWS SDK (emr), avro (program-report), Hadoop YARN JSON, google-cloud-storage (dataproc) and google-http-client-jackson2 (cloudkms).SparkRunnerClassLoaderonly filters thecom.fasterxml.jackson.*package, so Spark programs keep using Spark's own Jackson; bumpingjackson-module-scala_2.12does not touch$SPARK_HOME/jars.Testing (JDK 1.8.0_382, Checkstyle on, 0 violations)
mvn package: cdap-runtime-ext-emr 1/1, cdap-runtime-ext-dataproc 85/85, cdap-securestore-ext-cloudkms 5/5.-Ptemplates -am):ReportGenerationAppTest3/3 (program-report, avro path); cdap-spark-core3_2.12 43/43; cdap-data-pipeline3_2.12DataPipelineTestSpark methods (testSparkSinkAndCompute,testInnerJoinSpark,testSparkSimpleMultipleSource) 3/3; cdap-unit-test-spark3_2.12Spark2Test6/7.Spark2Test.testPySparkfails only because the local Python is 3.13, which cannot import pyspark 3.3 (No module named 'typing.io'). The failure happens in the Python import, before any Jackson code runs. Please confirm it on CI, which uses an older Python.dependency:tree(emr, dataproc, cloudkms, program-report, app-fabric, spark-core3): everycom.fasterxml.jacksonartifact, including jaxrs-base, jaxrs-json-provider, module-jaxb-annotations and module-scala_2.12, resolves to 2.18.12.