CVE-2026-106452: yawkat LZ4 Java: LZ4BlockInputStream allocates an unvalidated compressed length from the stream header
Summary LZ4BlockInputStream grows its compressed-input buffer to the attacker-controlled compressedLen value from the legacy LZ4Block stream header before reading any payload bytes. A header-only input can therefore trigger a near-2 GiB allocation and exhaust the JVM heap.
Published Oct 7, 2026
Affected packages
at.yawk.lz4:lz4-java
- Ecosystem
- Maven
- Affected
- <= 1.11.1
- Fixed in
- 1.11.2
- Check
mvn dependency:tree -Dincludes=at.yawk.lz4:lz4-java
org.lz4:lz4-java
- Ecosystem
- Maven
- Affected
- <= 1.8.1
- Fixed in
- No patched version yet
- Check
mvn dependency:tree -Dincludes=org.lz4:lz4-java
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
LZ4BlockInputStream grows its compressed-input buffer to the attacker-controlled compressedLen value from the legacy LZ4Block stream header before reading any payload bytes. A header-only input can therefore trigger a near-2 GiB allocation and exhaust the JVM heap.
Details
In net.jpountz.lz4.LZ4BlockInputStream, refill() validates that compressedLen is nonnegative but does not cap it before allocation:
case COMPRESSION_METHOD_LZ4:
if (compressedBuffer.length < compressedLen) {
compressedBuffer = new byte[Math.max(compressedLen, compressedBuffer.length * 3 / 2)];
}
readFully(compressedBuffer, compressedLen);The paired LZ4BlockOutputStream never emits such a block. If compression is not smaller than the original block, it writes the block as RAW:
if (compressedLength >= o) {
compressMethod = COMPRESSION_METHOD_RAW;
compressedLength = o;
} else {
compressMethod = COMPRESSION_METHOD_LZ4;
}Existing readers generally accept noncanonical LZ4-method blocks where compressedLen >= originalLen, but no canonical writer found produces them.
Impact
Applications that pass attacker-controlled legacy LZ4Block streams to LZ4BlockInputStream can suffer heap exhaustion from a header-only input. The impact is availability-only and requires no valid compressed payload.
Patch
As of lz4-java 1.11.2, lz4-java rejects lz4 blocks where the compressed length is larger than uncompressed. Readers would generally emit these as raw blocks instead. You can use the new acceptOversizedBlocks flag to restore the old behavior, but this reintroduces the DoS vector.
Credited to yawkat.
References
- https://github.com/yawkat/lz4-java/security/advisories/GHSA-4v53-57pg-c464
- https://nvd.nist.gov/vuln/detail/CVE-2026-106452
- https://github.com/yawkat/lz4-java/commit/bb83dd16163cdb71231af06b0a5651881148a634
- https://github.com/yawkat/lz4-java/releases/tag/v1.11.2
- https://github.com/advisories/GHSA-4v53-57pg-c464
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. No analysis has been written for this entry yet. Methodology
More Maven vulnerabilities
All Maven entriesCVE-2026-106449
yawkat LZ4 Java: LZ4BlockInputStream with stopOnEmptyBlock=false recurses once per empty block, causing StackOverflowError
low3.7No fixOct 7, 2026CVE-2026-106450
yawkat LZ4 Java: LZ4FrameInputStream reallocates block buffers for every frame, allowing CPU and GC amplification from small inputs
medium5.3No fixOct 7, 2026CVE-2026-106451
yawkat LZ4 Java: Native library extraction to a shared temporary directory is vulnerable to file replacement by another local user
high7.3No fixOct 7, 2026CVE-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
medium5.3No fixOct 7, 2026CVE-2026-59949
LZ4 Java: Native XXHash implementations can crash the JVM when passed invalid byte array ranges
medium6.5No fixJul 24, 2026CVE-2025-66566
yawkat LZ4 Java has a possible information leak in Java safe decompressor
high8.2No fixDec 5, 2025
