CVE-2026-106449: yawkat LZ4 Java: LZ4BlockInputStream with stopOnEmptyBlock=false recurses once per empty block, causing StackOverflowError

Published Oct 6, 2026
·
Updated

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():

java 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.

Other sources

yawkat LZ4 Java provides LZ4 compression for Java. Prior to 1.11.4, net.jpountz.lz4.LZ4BlockInputStream configured with stopOnEmptyBlock set to false handles each well-formed empty LZ4Block by recursively calling refill(), allowing a long sequence of empty blocks in an attacker-controlled compressed stream to exhaust the decoding thread's stack and throw StackOverflowError. The default stopOnEmptyBlock setting is true and is not affected, and the issue does not cause memory corruption. This issue is fixed in version 1.11.4.

— NVD

Affected Software

3 affected componentsFixes available
maven/org.lz4/lz4-java<1.11.4
maven/org.lz4:lz4-java<=1.8.1
maven/at.yawk.lz4:lz4-java<=1.11.3
1.11.4

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade maven/at.yawk.lz4:lz4-java to a version that resolves this vulnerability.

    Fixed in 1.11.4
  2. Upgrade

    Upgrade lz4-java to a version that resolves this vulnerability.

    Fixed in 1.11.4
  3. Configuration

    Use the default stopOnEmptyBlock = true when decoding untrusted input.

    net.jpountz.lz4.LZ4BlockInputStream stopOnEmptyBlock = true
  4. Operational

    For older versions, catch StackOverflowError around the read loop.

Event History

Oct 6, 2026
CVE Published
via MITRE·07:46 PM
Data Sourced
via MITRE·07:46 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·08:17 PM
DescriptionSeverityWeakness
Oct 7, 2026
Advisory Published
via GitHub·08:35 PM
Data Sourced
via GitHub·08:35 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Which deployments are affected?

Only applications that use net.jpountz.lz4.LZ4BlockInputStream with stopOnEmptyBlock set to false are affected. The default setting is true and is not affected.

2

What does an attacker need to exploit this?

An attacker needs to supply or control a compressed stream containing a long sequence of well-formed empty LZ4 blocks that is decoded by the affected stream configuration. No privileges or user interaction are required, but exploitation has high attack complexity.

3

What is the impact if exploitation succeeds?

The decoding thread can exhaust its stack and throw StackOverflowError, resulting in an availability impact for that thread. The issue does not cause memory corruption.

4

What should be done if updating is not immediately possible?

Avoid configuring LZ4BlockInputStream with stopOnEmptyBlock set to false, particularly when decoding attacker-controlled compressed input. Using the default true setting avoids the affected behavior.

5

What version fixes the issue?

The issue is fixed in yawkat LZ4 Java version 1.11.4. Versions prior to 1.11.4 are affected when the vulnerable configuration is used.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203