CVE-2026-106449: yawkat LZ4 Java: LZ4BlockInputStream with stopOnEmptyBlock=false recurses once per empty block, causing StackOverflowError
Summary When LZ4BlockInputStream is configured with stopOnEmptyBlock = false (the mode for reading concatenated block streams), it handles each empty block by calling refill() recursively. A long run of empty blocks exhausts the thread stack and throws StackOverflowError out of read() or skip().
Published Oct 7, 2026
Affected packages
at.yawk.lz4:lz4-java
- Ecosystem
- Maven
- Affected
- <= 1.11.3
- Fixed in
- 1.11.4
- 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
When LZ4BlockInputStream is configured with stopOnEmptyBlock = false (the mode for reading concatenated block streams), it handles each empty block by calling refill() recursively. A long run of empty blocks exhausts the thread stack and throws StackOverflowError out of read() or skip().
Details
In net.jpountz.lz4.LZ4BlockInputStream.refill():
if (originalLen == 0 && compressedLen == 0) {
if (check != 0) {
throw new IOException("Stream is corrupted");
}
if (!stopOnEmptyBlock) {
refill();
} else {
finished = true;
}
return;
}Each well-formed empty block is 21 bytes and adds one stack frame, with no limit on nesting depth. In local testing, around 10,000 to 100,000 consecutive empty blocks (about 210 KB to 2.1 MB, depending on JIT state and thread stack size) threw StackOverflowError. StackOverflowError is an Error, not an IOException, so callers that only handle I/O errors for corrupt input don't catch it.
Impact
Applications that decode attacker-controlled LZ4Block streams with LZ4BlockInputStream.newBuilder().withStopOnEmptyBlock(false) or the deprecated LZ4BlockInputStream(InputStream, boolean) constructor can have the decoding thread fail with StackOverflowError. The default configuration (stopOnEmptyBlock = true) is not affected. There is no memory corruption. Availability impact only.
Patch
Fixed in lz4-java 1.11.4. Empty blocks are now skipped in a loop instead of by recursion, so any number of consecutive empty blocks uses constant stack space.
For older versions, the workaround is to use the default stopOnEmptyBlock = true for untrusted input, or catch StackOverflowError around the read loop.
References
- https://github.com/yawkat/lz4-java/security/advisories/GHSA-343h-94h5-c4wr
- https://nvd.nist.gov/vuln/detail/CVE-2026-106449
- https://github.com/yawkat/lz4-java/commit/c8ebf97d504fb34434fda46fc761e8202570e0d8
- https://github.com/yawkat/lz4-java/releases/tag/v1.11.4
- https://github.com/advisories/GHSA-343h-94h5-c4wr
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-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-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
