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
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.
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
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.
Credited to arpitjain099.
References
- https://github.com/yawkat/lz4-java/security/advisories/GHSA-6cx8-rjf8-pr8g
- https://nvd.nist.gov/vuln/detail/CVE-2026-106453
- https://github.com/yawkat/lz4-java/commit/6492ce5aca6bd03ff9e08ee18a2beb94c431371a
- https://github.com/yawkat/lz4-java/releases/tag/v1.11.2
- https://github.com/advisories/GHSA-6cx8-rjf8-pr8g
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-106452
yawkat LZ4 Java: LZ4BlockInputStream allocates an unvalidated compressed length from the stream header
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
