CVE-2026-59949: yawkat LZ4 Java: JVM Crash via Null Byte Array in lz4-java Streaming XXHash JNI (StreamingXXHash32JNI / StreamingXXHash64JNI)

Published Jul 24, 2026
·
Updated

Summary

Insufficient validation of byte array arguments in JNI-based XXHash implementations in lz4-java 1.11.0 and earlier allows callers to crash the JVM by passing an invalid array reference or invalid range to native XXHash methods.

This affects applications where an attacker can influence the byte array object or the off / len arguments passed to affected XXHash APIs. It does not affect the common case where only the contents of a valid byte array are attacker-controlled.

Java-based XXHash implementations are not affected.

Details

The JNI-backed XXHash implementations pass caller-provided byte array arguments to native code. The affected APIs are:

- XXHashFactory.nativeInstance().hash32().hash(byte[] buf, int off, int len, int seed) - XXHashFactory.nativeInstance().hash64().hash(byte[] buf, int off, int len, long seed) - XXHashFactory.nativeInstance().newStreamingHash32(seed).update(byte[] bytes, int off, int len) - XXHashFactory.nativeInstance().newStreamingHash64(seed).update(byte[] bytes, int off, int len)

Before the fix, the streaming JNI implementations did not validate bytes, off, or len before calling XXHashJNI.XXH32update / XXHashJNI.XXH64update. The non-streaming JNI implementations called SafeUtils.checkRange, but SafeUtils.checkRange(byte[], int, int) skipped all array access when len == 0, so a null byte array with a zero length could still reach JNI.

As a result:

- hash(null, 0, 0, seed) and update(null, 0, 0) could pass a null array reference to JNI, causing a fatal JVM crash in GetPrimitiveArrayCritical. - update(new byte[16], 0, Integer.MAXVALUE) could cause native XXHash code to read far beyond the end of the Java array, causing a fatal JVM crash and potentially exposing in-process memory to the native routine before the crash.

The oversized-length non-streaming hash(new byte[16], 0, Integer.MAXVALUE, seed) case was already rejected in Java before this fix. The missing validation affected the streaming oversized-length case and the zero-length null-array case for both streaming and non-streaming JNI XXHash APIs.

The impact of this vulnerability depends on how user code uses the XXHash API. Code that hashes attacker-controlled byte contents in a valid, correctly bounded array is not affected. Code may be affected if an attacker can cause the application to pass a null array, an attacker-controlled offset, or an attacker-controlled length to the native XXHash API. The primary impact is denial of service due to JVM termination. For oversized lengths, native code may also read outside the Java array before the process crashes.

Mitigation

lz4-java 1.11.1 fixes this issue without requiring changes in user code.

If you cannot upgrade, avoid passing attacker-controlled array references, offsets, or lengths to JNI-backed XXHash APIs. In particular, validate that arrays are non-null and that off and len describe a range fully contained in the array before calling native XXHash methods.

Using XXHashFactory.safeInstance() avoids the JNI boundary and is not affected by this native crash behavior.

Other sources

Insufficient validation of byte array arguments in JNI-based XXHash implementations in lz4-java 1.11.0 and earlier allows callers to crash the JVM by passing an invalid array reference or invalid range to native XXHash methods. This affects applications where an attacker can influence the byte array object or the off/len arguments passed to affected XXHash APIs.

The primary risk is denial of service through JVM termination. For oversized-length cases, native code may also read memory outside the Java array before crashing, potentially exposing in-process data.

Affected packages: - at.yawk.lz4:lz4-java <= 1.11.0 - org.lz4:lz4-java <= 1.8.1

Fixed in at.yawk.lz4:lz4-java 1.11.1.

Workaround: Use XXHashFactory.safeInstance() instead of nativeInstance(), as Java-based XXHash implementations are unaffected. Additionally, validate that arrays are non-null and that offset/length parameters fall within array bounds before calling native XXHash methods.

— Red Hat

yawkat LZ4 Java provides LZ4 compression for Java. Prior to 1.11.1, JNI-backed XXHash implementations fail to validate the byte array object and the off and len arguments in XXHashFactory.nativeInstance().hash32().hash(), XXHashFactory.nativeInstance().hash64().hash(), XXHashFactory.nativeInstance().newStreamingHash32().update(), and XXHashFactory.nativeInstance().newStreamingHash64().update(), allowing null arrays or oversized ranges to reach native code, read outside the Java array, and fatally terminate the JVM. This issue is fixed in version 1.11.1.

— MITRE

Affected Software

3 affected componentsFixes available
maven/org.lz4:lz4-java<=1.8.1
maven/at.yawk.lz4:lz4-java<=1.11.0
1.11.1
IBM DataStage on Cloud Pak for Data<=5.4.0.0

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

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

    Fixed in 1.11.1
  3. Compensating control

    If upgrading is not possible, use XXHashFactory.safeInstance() instead of XXHashFactory.nativeInstance(); Java-based XXHash implementations are not affected.

  4. Compensating control

    Before calling native XXHash methods, validate that byte arrays are non-null and that off and len describe a range fully contained within the array.

Event History

Jul 24, 2026
Advisory Published
via GitHub·04:13 PM
Data Sourced
via GitHub·04:13 PM
DescriptionSeverityWeaknessAffected Software
Aug 3, 2026
Data Sourced
via Red Hat·06:41 PM
DescriptionSeverityAffected Software
Aug 18, 2026
CVE Published
via MITRE·02:58 PM
Data Sourced
via MITRE·02:58 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·03:16 PM
DescriptionSeverityWeakness
Oct 27, 2026
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is the severity of CVE-2026-59949?

CVE-2026-59949 has a medium severity rating of 6.5.

2

How do I fix CVE-2026-59949?

To fix CVE-2026-59949, upgrade to lz4-java version 1.11.1 or later.

3

What type of vulnerability is CVE-2026-59949?

CVE-2026-59949 is classified as a null pointer dereference vulnerability.

4

What applications are affected by CVE-2026-59949?

CVE-2026-59949 affects applications using JNI-based XXHash implementations in lz4-java versions 1.11.0 and earlier.

5

What can an attacker do with CVE-2026-59949?

An attacker can crash the JVM by passing an invalid array reference or range to native XXHash methods.

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