CVE-2026-59949: LZ4 Java Native XXHash Implementations Can Crash Vulnerability

MODERATE
Advisory Identifier: GHSA-xx22-p4ch-683r
CVSS 6.5
CWE-125 CWE-476
Published
Advisory Summary

CVE-2026-59949 is a MODERATE (CVSS 6.5) native xxhash implementations can crash vulnerability (CWE-125: Out-of-bounds Read) affecting LZ4 Java libraries in the Maven ecosystem. The issue involves native xxhash implementations can crash the jvm when passed invalid byte array ranges. Remediation is available by upgrading affected packages to version 1.11.1.

CVE-2026-59949 at a Glance

CVE Identifier CVE-2026-59949
GHSA Identifier GHSA-xx22-p4ch-683r
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-125: Out-of-bounds Read
Affected Product LZ4 Java
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-59949

To remediate this vulnerability, upgrade all affected LZ4 Java dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

at.yawk.lz4:lz4-java fixed: 1.11.1
<dependency>
    <groupId>at.yawk.lz4</groupId>
    <artifactId>lz4-java</artifactId>
    <version>1.11.1</version>
</dependency>
org.lz4:lz4-java fixed: Latest secure release
<dependency>
    <groupId>org.lz4</groupId>
    <artifactId>lz4-java</artifactId>
    <version>Latest secure release</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=at.yawk.lz4

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2026-59949, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=at.yawk.lz4

Analyze the terminal output to locate any version of LZ4 Java in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.11.1), your application is affected.

Note: The mvn dependency:tree -Dincludes=at.yawk.lz4 command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-125: Out-of-bounds Read, where the product reads data past the end, or before the beginning, of the intended buffer. In LZ4 Java, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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.XXH32_update` / `XXHashJNI.XXH64_update`. 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.MAX_VALUE)` 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.MAX_VALUE, 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.

CVE-2026-59949 Affected LZ4 Java Versions

2 component(s)
Fixed Versions:
1.11.1
Product / Package Ecosystem Affected Versions Fixed Version
at.yawk.lz4:lz4-java
Maven
< 1.11.1
1.11.1
org.lz4:lz4-java
Maven
≤ 1.8.1

References

Frequently Asked Questions

What is CVE-2026-59949?
CVE-2026-59949 is a security vulnerability in LZ4 Java involving Native XXHash implementations can crash the JVM when passed invalid byte array ranges under CWE-125: Out-of-bounds Read.
Which LZ4 Java versions are affected?
Affected versions include releases prior to 1.11.1 across affected packages: at.yawk.lz4:lz4-java, org.lz4:lz4-java.
What version fixes CVE-2026-59949?
Upgrading to 1.11.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is lz4-java affected?
Yes, at.yawk.lz4:lz4-java is affected in releases prior to 1.11.1, Latest secure release. Upgrade your dependency to 1.11.1, Latest secure release or later.
What is the CVSS score of CVE-2026-59949?
CVE-2026-59949 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:H.
What CWE is associated with CVE-2026-59949?
CVE-2026-59949 is classified under CWE-125: Out-of-bounds Read (The product reads data past the end, or before the beginning, of the intended buffer.).
How can I check Maven dependencies for CVE-2026-59949?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=at.yawk.lz4'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-xx22-p4ch-683r",
  "modified" : "2026-07-24T16:13:41Z",
  "published" : "2026-07-24T16:13:41Z",
  "aliases" : [ "CVE-2026-59949" ],
  "summary" : "LZ4 Java: Native XXHash implementations can crash the JVM when passed invalid byte array ranges",
  "details" : "### Summary\n\nInsufficient 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.\n\nThis 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.\n\nJava-based XXHash implementations are *not* affected.\n\n### Details\n\nThe JNI-backed XXHash implementations pass caller-provided byte array arguments to native code. The affected APIs are:\n\n- `XXHashFactory.nativeInstance().hash32().hash(byte[] buf, int off, int len, int seed)`\n- `XXHashFactory.nativeInstance().hash64().hash(byte[] buf, int off, int len, long seed)`\n- `XXHashFactory.nativeInstance().newStreamingHash32(seed).update(byte[] bytes, int off, int len)`\n- `XXHashFactory.nativeInstance().newStreamingHash64(seed).update(byte[] bytes, int off, int len)`\n\nBefore the fix, the streaming JNI implementations did not validate `bytes`, `off`, or `len` before calling `XXHashJNI.XXH32_update` / `XXHashJNI.XXH64_update`. 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.\n\nAs a result:\n\n- `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`.\n- `update(new byte[16], 0, Integer.MAX_VALUE)` 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.\n\nThe oversized-length non-streaming `hash(new byte[16], 0, Integer.MAX_VALUE, 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.\n\nThe 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.\n\n### Mitigation\n\nlz4-java 1.11.1 fixes this issue without requiring changes in user code.\n\nIf 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.\n\nUsing `XXHashFactory.safeInstance()` avoids the JNI boundary and is not affected by this native crash behavior.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "at.yawk.lz4:lz4-java"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.11.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.11.0"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.lz4:lz4-java"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "1.8.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/yawkat/lz4-java/security/advisories/GHSA-xx22-p4ch-683r"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/yawkat/lz4-java/commit/dbd86d04b8dd716e1c2bc626be54189997d910da"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/yawkat/lz4-java"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/yawkat/lz4-java/releases/tag/v1.11.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-125", "CWE-476" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-24T16:13:41Z",
    "nvd_published_at" : null
  }
}