CVE-2026-106452: yawkat LZ4 Java: LZ4BlockInputStream allocates an unvalidated compressed length from the stream header

Published Oct 6, 2026
·
Updated

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:

java case COMPRESSIONMETHODLZ4: 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:

java if (compressedLength >= o) { compressMethod = COMPRESSIONMETHODRAW; compressedLength = o; } else { compressMethod = COMPRESSIONMETHODLZ4; }

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.

Other sources

yawkat LZ4 Java provides LZ4 compression for Java. Prior to 1.11.2, net.jpountz.lz4.LZ4BlockInputStream refill() validates that the compressedLen field in a legacy LZ4Block header is nonnegative but allocates a compressed-input buffer of that attacker-controlled size before reading payload data, allowing a header-only stream to request a near-2 GiB allocation and exhaust the JVM heap. Canonical writers emit raw blocks when compression is not smaller than the original block, but vulnerable readers accept non-canonical oversized compressed blocks. This issue is fixed in version 1.11.2.

— MITRE

Affected Software

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

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.2
  2. Upgrade

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

    Fixed in 1.11.2

Event History

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

Frequently Asked Questions

1

Which applications are exposed to this issue?

Applications using yawkat LZ4 Java before version 1.11.2 are exposed when they pass attacker-controlled or otherwise untrusted LZ4 legacy block streams to net.jpountz.lz4.LZ4BlockInputStream.

2

What does an attacker need to do to trigger the problem?

An attacker only needs to provide a crafted stream header with a very large nonnegative compressedLen value. The stream can be header-only; no payload data is required before the vulnerable reader attempts the allocation.

3

Is this limited to streams produced by standard LZ4 writers?

No. Canonical writers emit raw blocks when compression would not reduce the block size, but vulnerable readers accept non-canonical oversized compressed blocks. Exploitation relies on such an oversized crafted block rather than normal canonical output.

4

What is the impact of successful exploitation?

The vulnerable reader can attempt to allocate a compressed-input buffer approaching 2 GiB, which can exhaust the JVM heap and cause a denial of service. The provided severity vector indicates no confidentiality or integrity impact.

5

What should be done to remediate the issue?

Upgrade yawkat LZ4 Java to version 1.11.2, which fixes the issue. Until upgrading, avoid processing untrusted LZ4 legacy block streams with the affected reader.

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