GHSA-4v53-57pg-c464: Medium severity maven/org.lz4:lz4-java vulnerability

Published Oct 7, 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.

Affected Software

2 affected componentsFixes available
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 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?

Applications are exposed if they pass attacker-controlled legacy LZ4Block streams to LZ4BlockInputStream. The issue is in the reader’s handling of the stream header before payload bytes are read.

2

What does an attacker need to provide to trigger the issue?

A header-only legacy LZ4Block input with an attacker-controlled, very large nonnegative compressedLen field can trigger allocation of a buffer approaching 2 GiB. No compressed payload bytes are required.

3

Can streams produced by the paired LZ4BlockOutputStream cause this condition?

The paired writer does not produce the problematic form: when compressed data is not smaller than the original block, it writes a RAW block instead. The affected reader nevertheless accepts noncanonical LZ4-method blocks with compressedLen greater than or equal to originalLen.

4

What is the practical impact of successful exploitation?

The allocation can exhaust the JVM heap, causing an availability impact. The provided severity vector indicates no confidentiality or integrity impact.

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