Skip to content

Move netty-all, netty-http and kafka_2.12 to test scope - #252

Open
deepika-lalwani123 wants to merge 1 commit into
developfrom
vuln/kp-1-test-scope-netty-kafka
Open

deepika-lalwani123 wants to merge 1 commit into
developfrom
vuln/kp-1-test-scope-netty-kafka

Conversation

@deepika-lalwani123

@deepika-lalwani123 deepika-lalwani123 commented Nov 17, 2026 •

Copy link
Copy Markdown

Move netty-all, netty-http and kafka_2.12 to test scope
Repo: data-integrations/kafka-plugins
Commit: cfdfe35
Part of the CVE fixes for the CDAP 6.11.2 patch release (container image scanning of gcr.io/cdapio/cdap).

kafka-plugins-client declared netty-all, netty-http and the kafka_2.12
broker at compile scope, so the plugin jar packaged about 30 Netty
4.1.75 / 4.1.48 modules, kafka_2.12 2.6.0 and ZooKeeper 3.5.8 under
lib/. Image scanning of gcr.io/cdapio/cdap reports the Netty, kafka_2.12
and ZooKeeper CVEs against
/opt/cdap/master/artifacts/kafka-plugins-client-*.jar/lib/.

Only the embedded-broker unit tests use these jars: every kafka.,
scala.
, io.netty., io.cdap.http. and org.apache.zookeeper.* import is
under src/test. Main code uses only org.apache.kafka.clients/common from
kafka-clients. The root POM already declares netty-all and netty-http as
test scope; the client module overrode that.

Versions:

  • io.netty:netty-all 4.1.75.Final: compile -> test (kafka-plugins-client)
  • io.cdap.http:netty-http 1.3.0: compile -> test (kafka-plugins-client)
  • org.apache.kafka:kafka_2.12 2.6.0: compile -> test (kafka-plugins-client),
    which also drops zookeeper 3.5.8, scala-library/-reflect 2.12.11,
    jackson-module-scala and metrics-core from the plugin jar

The plugins changes are complete for the kafka-plugins Netty and
ZooKeeper findings.

Risk: low. No main-code dependency on the removed jars. Scala comes from
the Spark runtime that already provides spark-streaming at runtime.

Testing: JDK 8, Checkstyle on (0 violations).
mvn -B clean install (all modules): BUILD SUCCESS, 13 tests, 0 failures
(KafkaBatchSourceTest, KafkaSinkAndAlertsPublisherTest,
KafkaStreamingSourceTest, KafkaStreamingSourceUtilTest).
unzip -l kafka-plugins-client-3.5.0-SNAPSHOT.jar: lib/ goes from 74 to
26 jars; no netty-
, kafka_2.12-, zookeeper- or scala-* left; nothing
added. mvn dependency:tree -Dincludes=io.netty,org.apache.kafka,
org.apache.zookeeper,io.cdap.http: kafka_2.12, netty-all and netty-http
are test scope; the only compile-scope match is kafka-clients 2.6.0.

kafka-plugins-client declared netty-all, netty-http and the kafka_2.12
broker at compile scope, so the plugin jar packaged about 30 Netty
4.1.75 / 4.1.48 modules, kafka_2.12 2.6.0 and ZooKeeper 3.5.8 under
lib/. Image scanning of gcr.io/cdapio/cdap reports the Netty, kafka_2.12
and ZooKeeper CVEs against
/opt/cdap/master/artifacts/kafka-plugins-client-*.jar/lib/.

Only the embedded-broker unit tests use these jars: every kafka.*,
scala.*, io.netty.*, io.cdap.http.* and org.apache.zookeeper.* import is
under src/test. Main code uses only org.apache.kafka.clients/common from
kafka-clients. The root POM already declares netty-all and netty-http as
test scope; the client module overrode that.

Versions:
- io.netty:netty-all 4.1.75.Final: compile -> test (kafka-plugins-client)
- io.cdap.http:netty-http 1.3.0: compile -> test (kafka-plugins-client)
- org.apache.kafka:kafka_2.12 2.6.0: compile -> test (kafka-plugins-client),
  which also drops zookeeper 3.5.8, scala-library/-reflect 2.12.11,
  jackson-module-scala and metrics-core from the plugin jar

Bugs: b/578427766, b/578434052, b/578497139 (kafka_2.12); Plugins side
done for the kafka-plugins Netty bugs and zookeeper b/578633351.

Risk: low. No main-code dependency on the removed jars. Scala comes from
the Spark runtime that already provides spark-streaming at runtime.

Testing: JDK 8, Checkstyle on (0 violations).
mvn -B clean install (all modules): BUILD SUCCESS, 13 tests, 0 failures
(KafkaBatchSourceTest, KafkaSinkAndAlertsPublisherTest,
KafkaStreamingSource*Test, KafkaStreamingSourceUtilTest).
unzip -l kafka-plugins-client-3.5.0-SNAPSHOT.jar: lib/ goes from 74 to
26 jars; no netty-*, kafka_2.12-*, zookeeper-* or scala-* left; nothing
added. mvn dependency:tree -Dincludes=io.netty,org.apache.kafka,
org.apache.zookeeper,io.cdap.http: kafka_2.12, netty-all and netty-http
are test scope; the only compile-scope match is kafka-clients 2.6.0.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the kafka-plugins-client/pom.xml file to restrict the scope of several dependencies (kafka_2.12, netty-all, and netty-http) to test. This ensures these dependencies are only used for unit testing and are not packaged into the production artifact. I have no feedback to provide as the changes are appropriate and there are no review comments.

@deepika-lalwani123 deepika-lalwani123 added the build Trigger unit test build label Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Trigger unit test build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant