CVE-2026-106453
yawkat LZ4 Java: LZ4DecompressorWithLength allocates the unvalidated size from the 4-byte length header, so a 5-byte input triggers a 1 GiB allocation and OutOfMemoryError
Description
Summary
LZ4DecompressorWithLength.decompress(byte[], int) allocates whatever size the 4-byte length header declares, before it reads a single byte of compressed data. A 5-byte input whose header says 0x40000000 makes the JVM commit a gigabyte and can cause heap exhaustion.
Details
net.jpountz.lz4.LZ4DecompressorWithLength reads the header and passes it straight on:
final int destLen = getDecompressedLength(src, srcOff);
return fastDecompressor.decompress(src, srcOff + 4, destLen);
and net.jpountz.lz4.LZ4FastDecompressor allocates it:
public final byte[] decompress(byte[] src, int srcOff, int destLen) {
final byte[] decompressed = new byte[destLen];
decompress(src, srcOff, decompressed, 0, destLen);
return decompressed;
}
getDecompressedLength performs no validation: no comparison against src.length, no ceiling, no rejection of negatives. LZ4SafeDecompressor.decompress(byte[], int, int, int) has the same shape with maxDestLen.
The sibling overload that callers pass their own buffer to, decompress(src, srcOff, dest, destOff, destLen), is fine, because there destLen is chosen by the caller rather than by the input. The bug is specific to the convenience overloads that take the size from the header, and that difference is the whole finding.
Impact
Any application that decompresses attacker-supplied LZ4 frames through the with-length convenience API can be made to allocate up to 2 GiB per call from a 5-byte message. On a service that decompresses request bodies, a few concurrent 5-byte requests exhaust the heap. No privileges are needed, only the ability to get bytes into the decompressor. Confidentiality and integrity are untouched.
Affected Maven artifacts (2)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| at.yawk.lz4 » lz4-java | < 1.11.2 | 1.11.2 |
| org.lz4 » lz4-java | <= 1.8.1 | - |
Blast radius
71% of the dependent artifacts (13,655) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 43,185 |
| 2 hops | 404,384 |
| 3 hops | 307,756 |
| 4 hops | 194,756 |
| 5 hops | 73,931 |
| 6 hops | 22,098 |
Most used dependents
- org.apache.hadoop » hadoop-common3,482 usages
- org.apache.spark » spark-sql3,174 usages
- org.apache.kafka » kafka-clients3,135 usages
- org.apache.spark » spark-core2,899 usages
- org.codehaus.mojo » buildnumber-maven-plugin2,777 usages
- com.typesafe.play » play-test1,902 usages
- org.apache.hadoop » hadoop-client1,796 usages
- org.apache.kafka » kafka1,450 usages
- com.typesafe.play » play-server1,436 usages
- com.typesafe.play » play-logback1,380 usages
- org.elasticsearch » elasticsearch1,377 usages
- org.apache.hadoop » hadoop-mapreduce-client-core1,366 usages
- org.scalatestplus.play » scalatestplus-play1,286 usages
- com.jetbrains.intellij.platform » core1,284 usages
- com.typesafe.play » play-akka-http-server1,152 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
References
- Webhttps://github.com/yawkat/lz4-java/security/advisories/GHSA-6cx8-rjf8-pr8g
- Advisoryhttps://nvd.nist.gov/vuln/detail/CVE-2026-106453
- Webhttps://github.com/yawkat/lz4-java/commit/6492ce5aca6bd03ff9e08ee18a2beb94c431371a
- Packagehttps://github.com/yawkat/lz4-java
- Webhttps://github.com/yawkat/lz4-java/releases/tag/v1.11.2
