Skip to content

Bump org.json to 20260719 - #2015

Open
deepika-lalwani123 wants to merge 3 commits into
developfrom
vuln/hp-2b-org-json
Open

deepika-lalwani123 wants to merge 3 commits into
developfrom
vuln/hp-2b-org-json

Conversation

@deepika-lalwani123

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

Copy link
Copy Markdown

Bump org.json to 20260719

Stacked PR: this branch is built on top of #2013, #2014. Against develop the diff includes those commits; please review only the top commit f3d6233a2a. Merge after #2014.

Repo: cdapio/hydrator-plugins
Base: develop (stacked)
Commit: f3d6233
Part of the CVE fixes for the CDAP 6.11.2 patch release (container image scanning of gcr.io/cdapio/cdap).

Image scanning of gcr.io/cdapio/cdap reports org.json:json 20160212 in
transform-plugins-*.jar (3 CVEs). transform-plugins is the only module
that uses ${json.version}; only XMLToJSON uses org.json (JSONObject,
XML.toJSONObject). Kept separate from the other minor bumps because
newer org.json changes behavior: numbers are parsed as BigDecimal /
BigInteger where needed, and XML.toJSONObject keeps strings with leading
zeros and some other values that the old version coerced.

Versions:

  • org.json:json 20160212 -> 20260719 (root json.version)

Findings: none closed alone in hydrator-plugins (the 3 org.json findings close
once data-integrations/wrangler#1072 and data-integrations/google-cloud#1635 also land).

Risk: medium. The XMLToJSON output can differ for numeric-looking
values (for example leading zeros and very large / high-precision
numbers).

Testing: JDK 8, Checkstyle on (0 violations).
mvn -DcloudBuild clean verify -pl transform-plugins -am: BUILD SUCCESS;
transform-plugins 100 tests pass (1 skipped, ValueMapperTest, as on
the #2014 run), including XMLToJSONConverterTest (4), XMLParserTest (8),
XMLMultiParserTest (2), JSONParserTest (8), JSONFormatterTest (2).
unzip -l transform-plugins jar: lib/json-20260719.jar (no
json-20160212). A sandbox pipeline with XMLToJSON was not run.

Image scanning of gcr.io/cdapio/cdap reports jline 3.9.0 and
jetty-http 9.4.51.v20230217 inside database-plugins-*.jar. dependency:tree
shows both come from hadoop-client 3.3.6 (compile scope) ->
hadoop-yarn-client 3.3.6 (jline 3.9.0, websocket-client -> jetty-client
-> jetty-http/-util/-io 9.4.51). The main code only uses
org.apache.hadoop.{conf,io,util,mapreduce,mapred.lib.db} classes, which
come from hadoop-common / hadoop-mapreduce-client-core that CDAP provides
at runtime, so hadoop-client is now provided. This also stops packaging
the rest of the Hadoop client tree (httpclient, commons-io 2.8.0,
commons-compress 1.21, reload4j, kerby, curator, jersey-client, jackson
jaxrs 2.12.7, ...) in the database-plugins jar.

The root-managed avro-mapred 1.11.4 pulled avro-ipc and avro-ipc-jetty,
which brought velocity-engine-core 2.3 (with commons-io 2.8.0) into the
format-avro jar (and through it format-parquet / google-cloud). No plugin
uses Avro IPC, so both are excluded.

Versions:
- hadoop-client 3.3.6: compile -> provided (database-plugins/pom.xml)
- avro-ipc, avro-ipc-jetty 1.11.4: excluded from avro-mapred (root
  dependencyManagement)

Bugs: Plugins side done for jline b/578444907, b/578489244, b/578492108,
b/578644778, b/578663138 and jetty-http b/578515513.

Risk: low. No main-code change; Hadoop classes are supplied by CDAP.
Downstream projects that relied on database-plugins pulling hadoop-client
transitively at compile scope must declare it themselves (none in this
repo).

Testing: JDK 8, Checkstyle on (0 violations).
mvn -DcloudBuild clean verify -pl database-plugins,format-avro,format-parquet -am:
BUILD SUCCESS; hydrator-common, format-common, format-avro,
format-parquet and database-plugins unit tests pass (database-plugins: 35
run, 1 skipped: DBConnectorTest assumes live-DB system properties). dependency:tree
-Dincludes=org.jline,org.eclipse.jetty,org.apache.avro:avro-ipc*,org.apache.velocity
shows jline/jetty only at provided/test scope and no avro-ipc or velocity.
unzip -l database-plugins jar: lib/ now only has hydrator-common, guava,
opentracing-* and common-0.1.4 (no jline, jetty, hadoop-*); format-avro
jar has no avro-ipc / velocity. DB source/sink against real MySQL /
Postgres not run (needs a database).
Image scanning of gcr.io/cdapio/cdap reports CVEs in jars packaged by
hydrator-plugins: log4j-core 2.20.0 / log4j-api 2.21.1 (format-xls,
core-plugins via poi), bcprov-jdk15to18 1.84 (core-plugins), commons-io
2.5 (format-delimited), json-smart 2.2.1 (transform-plugins via
json-path 2.2.0) and iq80 snappy 0.2 (format-orc via orc-core 1.1.0).

The root POM now imports log4j-bom and manages commons-io, json-smart
and iq80 snappy, so modules no longer pin their own versions. json-path
stays on 2.2.0 (2.9 would pull json-smart 2.5.x).

Versions:
- log4j2 (log4j-core, log4j-api) 2.20.0 / 2.21.1 -> 2.25.5 (root
  log4j2.version, log4j-bom import; format-xls log4j-core.version removed)
- bcprov-jdk15to18 1.84 -> 1.85 (core-plugins)
- commons-io 2.5 / 2.15.0 -> 2.16.1 (root commons-io.version + managed
  entry; format-delimited property and core-plugins / format-xls pins
  removed)
- json-smart 2.2.1 -> 2.4.10 (root json-smart.version, managed)
- iq80 snappy 0.2 -> 0.5 (root iq80-snappy.version, managed)

Bugs: Plugins side done for log4j-core b/578431300, b/578491647,
b/578514361, b/578514875. iq80 snappy is rows only (b/578567520 stays
open through the Platform leveldb exception).

Risk: low-medium. Same-major bumps. log4j 2.25.x and commons-io 2.16.1
still run on Java 8. commons-compress (1.26.0 in core-plugins /
format-xls) is not touched in this PR.

Testing: JDK 8, Checkstyle on (0 violations).
mvn -DcloudBuild clean verify -pl core-plugins,format-xls,format-delimited,transform-plugins,format-orc -am:
BUILD SUCCESS; core-plugins 328 tests (2 skipped), transform-plugins 100
(1 skipped), format-xls / format-delimited / format-orc and
dependencies all pass. dependency:tree
-Dincludes=org.apache.logging.log4j,org.bouncycastle,commons-io,net.minidev:json-smart,org.iq80.snappy
shows only log4j 2.25.5, bcprov-jdk15to18 1.85, commons-io 2.16.1,
json-smart 2.4.10 and snappy 0.5 at compile scope (smbj's
bcprov-jdk15on 1.70 is runtime scope and is not embedded). unzip -l of
the built jars: core-plugins lib/ has bcprov-jdk15to18-1.85,
commons-io-2.16.1, log4j-api-2.25.5; format-xls has log4j-core/-api
2.25.5, commons-io-2.16.1; format-delimited commons-io-2.16.1;
transform-plugins json-smart-2.4.10; format-orc snappy-0.5. Excel / ORC
/ SFTP pipelines in a sandbox not run.
Image scanning of gcr.io/cdapio/cdap reports org.json:json 20160212 in
transform-plugins-*.jar (3 CVEs). transform-plugins is the only module
that uses ${json.version}; only XMLToJSON uses org.json (JSONObject,
XML.toJSONObject). Kept separate from the other minor bumps because
newer org.json changes behavior: numbers are parsed as BigDecimal /
BigInteger where needed, and XML.toJSONObject keeps strings with leading
zeros and some other values that the old version coerced.

Versions:
- org.json:json 20160212 -> 20260719 (root json.version)

Bugs: none closed alone in hydrator-plugins (the 3 org.json bugs close
once WR-3b and GC-3b also land).

Risk: medium. The XMLToJSON output can differ for numeric-looking
values (for example leading zeros and very large / high-precision
numbers).

Testing: JDK 8, Checkstyle on (0 violations).
mvn -DcloudBuild clean verify -pl transform-plugins -am: BUILD SUCCESS;
transform-plugins 100 tests pass (1 skipped, ValueMapperTest, as on
the HP-2a run), including XMLToJSONConverterTest (4), XMLParserTest (8),
XMLMultiParserTest (2), JSONParserTest (8), JSONFormatterTest (2).
unzip -l transform-plugins jar: lib/json-20260719.jar (no
json-20160212). A sandbox pipeline with XMLToJSON was not run.

@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 centralizes and updates several dependency versions across multiple Maven modules. Key changes include upgrading Bouncy Castle (bcprov-jdk15to18) to version 1.85, centralizing commons-io to version 2.16.1, managing log4j versions via log4j-bom (version 2.25.5), and adding dependency management for json-smart and snappy. Additionally, it marks hadoop-client as provided in the database plugins and adds exclusions for unused Avro IPC dependencies. All review comments were filtered out as they pertained to non-code changes (version numbers), so there is no additional feedback to provide.

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.

2 participants