Vulnerabilities in pkg:maven/org.lz4/lz4-java

PACKAGE
Advisory Identifier: GHSA-mcr4-qmvw-px4g
Advisory Summary

CVE-2026-106451 is a HIGH native library extraction to a vulnerability (CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition) affecting yawkat LZ4 Java libraries in the Maven ecosystem. The issue involves native library extraction to a shared temporary directory is vulnerable to file replacement by another local user. Remediation is available by upgrading affected packages to version 1.11.4.

8 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/org.lz4/lz4-java

8 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/org.lz4/lz4-java. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-mcr4-qmvw-px4g CVE-2026-106451 HIGH yawkat LZ4 Java: Native library extraction to a shared temporary directory is vulnerable to file replacement by another local user
GHSA-343h-94h5-c4wr CVE-2026-106449 LOW yawkat LZ4 Java: LZ4BlockInputStream with stopOnEmptyBlock=false recurses once per empty block, causing StackOverflowError
GHSA-gm45-99xc-r7wv CVE-2026-106450 MODERATE yawkat LZ4 Java: LZ4FrameInputStream reallocates block buffers for every frame, allowing CPU and GC amplification from small inputs
GHSA-4v53-57pg-c464 CVE-2026-106452 MODERATE yawkat LZ4 Java: LZ4BlockInputStream allocates an unvalidated compressed length from the stream header
GHSA-6cx8-rjf8-pr8g CVE-2026-106453 MODERATE yawkat LZ4 Java: LZ4DecompressorWithLength allocates the unvalidated size from the 4-byte length header, so a 5-byte input triggers a 1 GiB allocation and OutOfMemoryError
GHSA-xx22-p4ch-683r CVE-2026-59949 MODERATE LZ4 Java: Native XXHash implementations can crash the JVM when passed invalid byte array ranges
GHSA-vqf4-7m7x-wgfc CVE-2025-12183 HIGH LZ4 Java Compression has Out-of-bounds memory operations which can cause DoS
GHSA-cmp6-m4wj-q63q CVE-2025-66566 HIGH yawkat LZ4 Java has a possible information leak in Java safe decompressor

CVE-2026-106451 at a Glance

CVE Identifier CVE-2026-106451
GHSA Identifier GHSA-mcr4-qmvw-px4g
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition
Affected Product yawkat LZ4 Java
Package Ecosystem Maven
Published Date
Last Updated

How to Fix CVE-2026-106451

To remediate this vulnerability, upgrade all affected yawkat 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.4
<dependency>
    <groupId>at.yawk.lz4</groupId>
    <artifactId>lz4-java</artifactId>
    <version>1.11.4</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-106451, 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 yawkat 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.4), 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-367: Time-of-check Time-of-use (TOCTOU) Race Condition, where the product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check. In yawkat 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 When no system-installed `liblz4-java` is found, `net.jpountz.util.Native.load()` extracts the bundled native library to `java.io.tmpdir` and loads it with `System.load`. The path of the extracted library can be predicted before it is created, and the library file is opened without exclusive creation. Another local user who can write to the same temporary directory can therefore create the file first and control the code that is loaded. ### Details ```java tempLibLock = File.createTempFile("liblz4-java-", "." + os().libExtension + ".lck"); tempLib = new File(tempLibLock.getAbsolutePath().replaceFirst(".lck$", "")); // copy to tempLib try (FileOutputStream out = new FileOutputStream(tempLib)) { ... } ... System.load(tempLib.getAbsolutePath()); ``` Only the `.lck` file is created safely, with a random name and exclusive creation. The library path is the `.lck` name without the `.lck` suffix, and nothing reserves it. `new FileOutputStream(tempLib)` opens it with `O_CREAT|O_TRUNC` and follows symlinks. In a shared, world-writable temporary directory, another user can watch for the `.lck` file and create the corresponding library file before it is opened. If they win that race, they own the file. The victim then writes into the attacker-owned file, and the attacker can overwrite it again before `System.load`. Whether this can be exploited depends on the host: - With `fs.protected_regular = 0`, the attacker can pre-create a world-writable file, and their code is then loaded into the victim's JVM. - With `fs.protected_regular >= 1` (the default on many systemd-based distributions), the victim's open fails. The library then fails to load and the library falls back to the Java implementations, so the attacker can only cause a denial of service. - A symlink variant is blocked by `fs.protected_symlinks = 1`. - Temporary directories without the sticky bit, or shared across users in containers, are exploitable whatever these settings are. This behaviour was introduced upstream in commit c3ddae5 (lz4-java 1.7.0), which swapped which of the two files is created with `createTempFile`. ### Impact A local user who can write to the same temporary directory as a victim process that uses the bundled JNI library may be able to execute code as the victim. Exploitation requires a shared temporary directory, host settings that permit it, and winning a race. The issue does not apply if `liblz4-java` is found on `java.library.path`, if `java.io.tmpdir` is private to the user (for example systemd `PrivateTmp`, or a per-user temporary directory), or if only the Java implementations are used. ### Patch Fixed in lz4-java 1.11.4. The native library is now extracted directly into a file created by `File.createTempFile`, which has a random name and is created exclusively, so a file or symlink planted in advance cannot be reused. The `.lck` lock files are no longer used. Instead, the startup cleanup removes stale `liblz4-java-*` temporary files (including `.lck` files left by older versions) only once they are more than one hour old. For older versions, the workaround is to set `java.io.tmpdir` to a directory writable only by the application user, or install `liblz4-java` on `java.library.path`.

CVE-2026-106451 Affected yawkat LZ4 Java Versions

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

References

Frequently Asked Questions

What is CVE-2026-106451?
CVE-2026-106451 is a security vulnerability in yawkat LZ4 Java involving Native library extraction to a shared temporary directory is vulnerable to file replacement by another local user under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition.
Which yawkat LZ4 Java versions are affected?
Affected versions include releases prior to 1.11.4 across affected packages: at.yawk.lz4:lz4-java, org.lz4:lz4-java.
What version fixes CVE-2026-106451?
Upgrading to 1.11.4 (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.4, Latest secure release. Upgrade your dependency to 1.11.4, Latest secure release or later.
What CWE is associated with CVE-2026-106451?
CVE-2026-106451 is classified under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition (The product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check.).
How can I check Maven dependencies for CVE-2026-106451?
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-mcr4-qmvw-px4g",
  "modified" : "2026-10-07T20:35:51Z",
  "published" : "2026-10-07T20:35:51Z",
  "aliases" : [ "CVE-2026-106451" ],
  "summary" : "yawkat LZ4 Java: Native library extraction to a shared temporary directory is vulnerable to file replacement by another local user",
  "details" : "### Summary\n\nWhen no system-installed `liblz4-java` is found, `net.jpountz.util.Native.load()` extracts the bundled native library to `java.io.tmpdir` and loads it with `System.load`. The path of the extracted library can be predicted before it is created, and the library file is opened without exclusive creation. Another local user who can write to the same temporary directory can therefore create the file first and control the code that is loaded.\n\n### Details\n\n```java\ntempLibLock = File.createTempFile(\"liblz4-java-\", \".\" + os().libExtension + \".lck\");\ntempLib = new File(tempLibLock.getAbsolutePath().replaceFirst(\".lck$\", \"\"));\n// copy to tempLib\ntry (FileOutputStream out = new FileOutputStream(tempLib)) { ... }\n...\nSystem.load(tempLib.getAbsolutePath());\n```\n\nOnly the `.lck` file is created safely, with a random name and exclusive creation. The library path is the `.lck` name without the `.lck` suffix, and nothing reserves it. `new FileOutputStream(tempLib)` opens it with `O_CREAT|O_TRUNC` and follows symlinks.\n\nIn a shared, world-writable temporary directory, another user can watch for the `.lck` file and create the corresponding library file before it is opened. If they win that race, they own the file. The victim then writes into the attacker-owned file, and the attacker can overwrite it again before `System.load`.\n\nWhether this can be exploited depends on the host:\n\n- With `fs.protected_regular = 0`, the attacker can pre-create a world-writable file, and their code is then loaded into the victim's JVM.\n- With `fs.protected_regular >= 1` (the default on many systemd-based distributions), the victim's open fails. The library then fails to load and the library falls back to the Java implementations, so the attacker can only cause a denial of service.\n- A symlink variant is blocked by `fs.protected_symlinks = 1`.\n- Temporary directories without the sticky bit, or shared across users in containers, are exploitable whatever these settings are.\n\nThis behaviour was introduced upstream in commit c3ddae5 (lz4-java 1.7.0), which swapped which of the two files is created with `createTempFile`.\n\n### Impact\n\nA local user who can write to the same temporary directory as a victim process that uses the bundled JNI library may be able to execute code as the victim. Exploitation requires a shared temporary directory, host settings that permit it, and winning a race.\n\nThe issue does not apply if `liblz4-java` is found on `java.library.path`, if `java.io.tmpdir` is private to the user (for example systemd `PrivateTmp`, or a per-user temporary directory), or if only the Java implementations are used.\n\n### Patch\n\nFixed in lz4-java 1.11.4. The native library is now extracted directly into a file created by `File.createTempFile`, which has a random name and is created exclusively, so a file or symlink planted in advance cannot be reused. The `.lck` lock files are no longer used. Instead, the startup cleanup removes stale `liblz4-java-*` temporary files (including `.lck` files left by older versions) only once they are more than one hour old.\n\nFor older versions, the workaround is to set `java.io.tmpdir` to a directory writable only by the application user, or install `liblz4-java` on `java.library.path`.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "at.yawk.lz4:lz4-java"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.11.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.11.3"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.lz4:lz4-java"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.7.0"
      }, {
        "last_affected" : "1.8.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/yawkat/lz4-java/security/advisories/GHSA-mcr4-qmvw-px4g"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-106451"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/yawkat/lz4-java/commit/7a48b7f6b8099b9dab6541e4ac2ee0979dc55aa3"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/yawkat/lz4-java"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/yawkat/lz4-java/releases/tag/v1.11.4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-367", "CWE-377" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-10-07T20:35:51Z",
    "nvd_published_at" : "2026-10-06T20:17:27Z"
  }
}