fix(deps): bump jackson to 2.18.8 to fix CVE-2025-52999 (high-severity DoS)#221
Conversation
jackson-core 2.14.2 is vulnerable to CVE-2025-52999 (HIGH, CVSS 8.7): a StackOverflowError when parsing deeply nested JSON, enabling a remote DoS. The fix is jackson-core 2.15.0+, which adds StreamReadConstraints with a default nesting limit of 1000. - Bump jackson-core and jackson-databind 2.14.2 -> 2.18.8 (kept aligned). - shadowJar: exclude META-INF/versions/21/** from the (unpublished) fat jar. jackson-core 2.15+ is a multi-release JAR carrying Java 21 (class-file major 65) classes; the Shadow 8.1.1 plugin relocates com.fasterxml and its ASM cannot read major 65 ("Unsupported class file major version 65"). Dropping the JDK-21-only variants is safe: the base classes remain and multi-release fallback applies. This is the same shadowJar failure that blocks the dependabot bump in #217. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
rohanshah18
left a comment
There was a problem hiding this comment.
Thank you for fixing this! Changes do make sense. Just one question, any particular reason for choosing v2.18.8 instead of the latest version?
Bump jackson-core/databind 2.18.8 -> 2.22.0 (latest 2.x) per review feedback on #221. 2.22.0 is still Java 8 compatible and has the same multi-release profile (Java 21 classes under META-INF/versions/21), so the existing shadowJar exclude is unchanged. jackson 3.x is not an option: it uses new coordinates (tools.jackson.*) and requires Java 17, while this client targets Java 8. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Thanks for the review @rohanshah18! No strong reason — I'd initially matched the A couple of notes on the version choice:
CI is re-running on the new commit; I'll keep an eye on it. |
Per review: 2.22 is not a long-term-support branch, while 2.21 is an LTS release (~2-year support window with security backports) — a better fit for a published client library. 2.21.4 is Java 8 compatible with the same multi-release profile, so the shadowJar exclude is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Great call — you're right, 2.22 is non-LTS (short-lived branch) and 2.21 is the LTS line with a ~2-year support window and security backports, which is the better choice for a published library. Switched to the latest 2.21 patch,
|
Summary
Fixes CVE-2025-52999 (HIGH, CVSS v4 8.7) in
jackson-core2.14.2 — aStackOverflowErrorwhen parsing deeply nested JSON that allows an unauthenticated remote denial of service. The fix is jackson-core ≥ 2.15.0, which introducesStreamReadConstraints(default max nesting depth = 1000).Changes
com.fasterxml.jackson.core:jackson-coreandjackson-databind2.14.2 → 2.18.8 (kept on the same version to avoid core/databind drift).jackson-annotationsfollows transitively at 2.18.8.shadowJar:exclude 'META-INF/versions/21/**'.Why the shadowJar exclude is needed
jackson-core 2.15+ ships as a multi-release JAR that bundles Java 21 (class-file major 65) variants under
META-INF/versions/21. The Shadow 8.1.1 plugin relocatescom.fasterxml, and its bundled ASM cannot read major version 65, failing the build withUnsupported class file major version 65. This is the same failure that currently blocks the Dependabot bump in #217 (its CI is red on allbuildjobs).Dropping the JDK-21-only optimized classes from the fat jar is safe:
*-all.jar) is not the published Maven artifact — publishing usescomponents.java(the thin jar) with a normal dependency POM.versions/9/11/17are retained.A more thorough alternative is to modernize the Shadow plugin (
com.gradleup.shadow). I kept that out of this CVE fix because the Java-8 CI matrix job constrains us to shadow ≤ 8.3.1 and the upgrade carries package/DSL changes I couldn't validate on a Java 8 build JVM locally. Happy to do it as a follow-up.Verification
./gradlew clean build jar compileIntegrationTestJava→ BUILD SUCCESSFUL, 90/90 unit tests pass (JDK 17, Gradle 8.5).*-all.jar: relocated jackson present,StreamReadConstraintspresent (the CVE fix),META-INF/versions/21removed,versions/9/11/17retained.Notes
jackson-coreand is red in CI). This PR bumps both modules and unblocks the build. Recommend closing Bump com.fasterxml.jackson.core:jackson-core from 2.14.2 to 2.18.6 #217 once this merges.🤖 Generated with Claude Code
Note
Medium Risk
Touches JSON parsing on all Jackson code paths and changes fat-jar contents; behavior change is intended (nesting limits) with a targeted Shadow workaround rather than a plugin upgrade.
Overview
Upgrades Jackson (
jackson-coreandjackson-databind) from 2.14.2 → 2.21.4 in main and test dependencies, addressing CVE-2025-52999 (high-severity DoS via deeply nested JSON parsing in olderjackson-core).Unblocks the Shadow fat JAR build after the bump:
shadowJarnow excludesMETA-INF/versions/21/**so Shadow 8.1.1’s relocation ofcom.fasterxmlno longer hits Java 21 (class major 65) multi-release entries that its ASM cannot process. JDK-21-only optimized classes are omitted from the*-all.jar; the published thin Maven artifact is unchanged.Reviewed by Cursor Bugbot for commit ed1ef40. Bugbot is set up for automated code reviews on this repo. Configure here.