NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · Maven

CVE-2026-108106: snappy-java: Unbounded memory allocation from attacker-declared uncompressed lengtha

highCVSS 3.1 7.5GHSA-q233-g92q-qxp6

snappy-java up to 1.1.10.8 allocates the output buffer from the uncompressed length written in the first bytes of the input, before it checks anything. A few crafted bytes can force up to 2 GB of allocation and an OutOfMemoryError. Upgrade org.xerial.snappy:snappy-java to 1.1.10.9.

Published Oct 27, 2026 · Analysis Nov 1, 2026

What an attacker can do

Several decompression paths read the declared uncompressed length from the header of the Snappy data and size the output array from it. Declared lengths near 2 GB cause a huge allocation and OutOfMemoryError. Lengths of 2^31 or more cause NegativeArraySizeException.

The affected entry points include Snappy.uncompress(byte[]), Snappy.uncompressString, the Snappy.uncompress*Array methods, SnappyInputStream and SnappyFramedInputStream. The maxChunkSize limit added for CVE-2023-43642 bounds only the compressed chunk length, so it does not stop this.

An attacker needs any way to hand compressed data to an application that decompresses it: a Kafka, Hadoop or Cassandra style message path, an upload, or an API that takes Snappy payloads. A tiny request is enough, and the result is a crashed or stalled JVM. The CVSS vector is network, no privileges, high availability impact and nothing else.

Who is affected

Affected: org.xerial.snappy:snappy-java up to and including 1.1.10.8, in applications that decompress data from untrusted sources. The library is often a transitive dependency, so check the resolved tree:

mvn dependency:tree -Dincludes=org.xerial.snappy

For Gradle, run gradle dependencies and search for snappy-java. Fat jars and shaded copies also need a check.

org.xerial.snappy:snappy-java

Ecosystem
Maven
Affected
<= 1.1.10.8
Fixed in
1.1.10.9
Check
mvn dependency:tree -Dincludes=org.xerial.snappy:snappy-java

How to fix it

Upgrade to snappy-java 1.1.10.9.

mvn versions:use-dep-version -Dincludes=org.xerial.snappy:snappy-java -DdepVersion=1.1.10.9

Snappy.uncompressedLength() now rejects negative declared lengths and lengths above what a valid Snappy stream of that size can produce. The densest element expands 3 bytes to 64, so the cap is 64/3 of the compressed size, and allocation follows the input actually received. Workaround from the advisory: before decompressing untrusted data, check that Snappy.uncompressedLength(input) is within an application-specific limit.

How to tell if you were hit

Look for OutOfMemoryError or NegativeArraySizeException in logs, with stack frames in org.xerial.snappy.Snappy, SnappyInputStream or SnappyFramedInputStream. Watch for sudden heap spikes from small incoming messages, and for restarts of consumers right after a particular message arrives. Dependency scanners show which services still carry snappy-java 1.1.10.8 or earlier.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Impact

Several decompression paths in snappy-java allocate an output buffer sized by the uncompressed length declared in the first bytes of the compressed data, before decompressing or validating it. A few bytes of crafted input can therefore force an allocation of up to 2 GB, causing OutOfMemoryError (denial of service), or a NegativeArraySizeException for declared lengths of 2^31 or more.

Affected entry points include Snappy.uncompress(byte[]), Snappy.uncompressString, the Snappy.uncompress*Array methods, SnappyInputStream, and SnappyFramedInputStream. The maxChunkSize limit added for CVE-2023-43642 bounds only the compressed chunk length, so it does not prevent this.

Patches

Fixed in 1.1.10.9 (#739). Snappy.uncompressedLength() now rejects negative declared lengths, and lengths larger than any valid Snappy stream of the given size can produce. The densest Snappy element expands 3 bytes to 64, so the limit is 64/3 of the compressed size. Allocations are therefore proportional to the input actually received.

Workarounds

Before decompressing untrusted data, check that Snappy.uncompressedLength(input) is within an application-specific limit.

Credited to 1seal, EndlssNightmare, taer, apvxlab, August829, trnguyencflt.

Questions

Does the older CVE-2023-43642 fix cover this?

No. The advisory says the maxChunkSize limit added for that issue bounds only the compressed chunk length, so it does not prevent this allocation.

Which version fixes the problem?

snappy-java 1.1.10.9. Versions up to and including 1.1.10.8 are affected.

What can I do before upgrading?

Check Snappy.uncompressedLength(input) against a limit suited to your application before decompressing untrusted data, as the advisory suggests.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More Maven vulnerabilities

All Maven entries