Fix dest buffer bounds check in Snappy.uncompress - #734
Open
pprabhala-oss wants to merge 1 commit into
Open
pprabhala-oss wants to merge 1 commit into
pprabhala-oss wants to merge 1 commit into
Conversation
Throw IllegalArgumentException when the destination is smaller than uncompressedLength() before calling native RawUncompress. Applied to both the byte[] and ByteBuffer overloads. Fixes xerial#728 (CVE-2026-90559)
pprabhala-oss
force-pushed
the
local/issue-728-uncompress-dest-bounds
branch
from
September 16, 2026 18:57
3fc0b26 to
9b58271
Compare
6 tasks
astubbs
added a commit
to astubbs/parallel-consumer
that referenced
this pull request
Sep 18, 2026
…atabind 2.18.10 until fixes ship (#520) `deps: whole-tree CVE scan` has been red on every open PR since the OSS Index feed picked up seven advisories the root pom's `excludeVulnerabilityIds` list did not know about - four components, none of them changed by any PR. Read from the report artifact of the failing run on #517 (run 35293625759) and reproduced with `bin/check-ossindex-audit.sh` against it: exit 2, the scan ran and found something. This commit answers each one, and `docs/inflight/deps-cve-backlog.md` carries the long form of every decision below. What a user sees: `parallel-consumer-core` now resolves `zstd-jni:1.5.7-17` instead of `1.5.7-12`, and `parallel-consumer-vertx` resolves Netty `4.1.138.Final` instead of `4.1.137.Final` through the `netty-bom` pin. Nothing else on the published classpath moves. zstd-jni 1.5.7-12, CVE-2026-87795 / CVE-2026-87823 / CVE-2026-89045 (CVSS to 8.8) - BUMPED to 1.5.7-17. The library is a direct compile dependency of `parallel-consumer-core` (since upstream's Kafka 3.1.0 bump) because `OffsetSimpleSerialisation` compresses the offset map with it, so the version lives in that pom, not in the root's `dependencyManagement` where lz4-java is pinned. All three are fixed in 1.5.7-14 (luben/zstd-jni advisories GHSA-ff36-7w3w-g8rm, GHSA-jfr6-9xqw-2g2q, GHSA-9jx2-gfp9-phfm). None is reachable from here - the defects are in the `ZstdDictCompress` constructor, the direct-`ByteBuffer` frame-size natives, and a caller-supplied negative length to `ZstdInputStreamNoFinalizer.read()`; kafka-clients uses the NoFinalizer streams with its own buffer sizes and PC uses `ZstdInputStream` / `ZstdOutputStream` - but the bump is free: the 1.5.7-17 jar is class-file 52 (Java 8) like 1.5.7-12, its pom adds no compile-scope dependency, and the release-line commits kept the public signatures `int` when the natives went `long`. Newest release rather than first fixed one. Kafka's own pin is 1.5.6-4 on 3.9 and 1.5.6-10 on trunk, so this stays ahead of anything kafka-clients ships, as it already was. netty 4.1.137.Final, CVE-2026-89044 (GHSA-hcvj-94mj-jp5c, 6.5, request smuggling through a malformed Transfer-Encoding in netty-codec-http / netty-codec-http2, 4.1.133 through 4.1.137) - BUMPED to 4.1.138.Final via the existing `netty.version` / `netty-bom` import. Third bump in the sequence #324 started; same answer, because a fixed release exists. 4.1.138.Final is class-file 50 (Java 6). snappy-java 1.1.10.8, CVE-2026-90559 (8.7, xerial/snappy-java#728, out-of-bounds write in `Snappy.uncompress(ByteBuffer, ByteBuffer)`) - EXCLUDED, standing. There is no fixed release: 1.1.10.8 is the newest on Central (July 2025), the issue is open, and the candidate fix xerial/snappy-java#734 is open and unmerged, so it is not TEMPORARY (that class is for a fix already merged upstream). The exclusion is argued on reachability, read from the 1.1.10.8 bytecode with javap rather than from the source: kafka-clients' `SnappyCompression` and PC's `OffsetSimpleSerialisation` construct only `SnappyInputStream` / `SnappyOutputStream` (PC's own snappy helpers there have no callers at all, main or test); those invoke only the `byte[]` overloads, sizing the output from `Snappy.uncompressedLength` first; and inside the jar the vulnerable `ByteBuffer` overload is reached only from `SnappyFramedInputStream`, which nothing here uses. Retire when a release carries the capacity check - bump in core's pom, delete the entry. jackson-databind 2.18.10 (example-streams only), CVE-2026-91776 / CVE-2026-91777 (6.9) - EXCLUDED, TEMPORARY-SINCE 2026-09-18. Both fixes are merged on the 2.18 branch (FasterXML/jackson-databind#6203 and FasterXML/jackson-databind#6204, 2026-09-14/15) and milestoned 2.18.11, which is not on Central. The `jackson-bom` Dependabot ignore is patch-permissive, so the 2.18.11 update PR is the retirement trigger, and `bin/check-cve-exclusions.sh` expires the entry at 90 days if it does not arrive. Evidence, run on this box (JDK 17 via mise, 8-processor cap): - `bin/check-cve-exclusions.sh`: green, with one temporary entry dated today. - `bin/check-ossindex-audit.sh` against a copy of the CI report edited as the plugin would report the post-change tree (bumped coordinates removed, the three new ids in `excludedVulnerabilities`): exit 0, nothing vulnerable, every remaining advisory excluded. A live scan needs the repo's OSS Index secrets, which are not on this box (anonymous requests 401), so whether 1.5.7-17 / 4.1.138.Final carry advisories of their own is proven by the next CI run, not here. - Core unit suite, `-Pci -pl parallel-consumer-core -am test` with CI's excluded groups: BUILD SUCCESS, no failures, no errors. - New `CompressionCodecsIT` (core, test-integration): produces 200 records per codec with `compression.type` gzip / snappy / lz4 / zstd and reads them back through PC intact. Nothing in the suite set `compression.type` before, so no test exercised the three native codec libraries end to end; this is the test the next codec bump points at. - `parallel-consumer-vertx` unit tests against Netty 4.1.138.Final: BUILD SUCCESS, and `dependency:tree` across all nine modules resolves Netty 4.1.138.Final and zstd-jni 1.5.7-17 everywhere. - `bin/check-all.sh`: no gate failed. Not done, on purpose: no CHANGELOG entry (generated at release), no move of jackson onto the 2.19/2.20 lines (only the 2.18 PRs exist; the line choice is `deps-deferred-majors.md`'s), and the zstd/snappy convergence split recorded in `deps-convergence-tail.md` is unchanged - the direct declarations already won that resolution before this commit. Co-authored-by: Claude Fable 5.1 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Throw IllegalArgumentException when the destination is smaller than uncompressedLength() before calling native RawUncompress. Applied to both the byte[] and ByteBuffer overloads.
Fixes #728 (CVE-2026-90559)