Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-106451 Overview
CVE-2026-106451 is a time-of-check time-of-use (TOCTOU) race condition in the yawkat LZ4 Java library, which provides LZ4 compression for Java applications. The flaw resides in net.jpountz.util.Native.load(), where the native library file is written to a predictable path in the shared temporary directory without exclusive creation semantics. A local attacker with write access to the same shared temporary directory can replace the extracted native library before System.load() consumes it, resulting in native code execution in the victim's JVM process. The issue affects versions 1.7.0 through 1.11.3 and is fixed in 1.11.4 [CWE-367].
Critical Impact
Local attackers sharing the system temporary directory can win a race condition to substitute the extracted LZ4 native library, executing arbitrary native code with the privileges of the Java process.
Affected Products
- yawkat lz4-java versions 1.7.0 through 1.11.3
- Java applications bundling the vulnerable net.jpountz.util.Native loader
- Deployments relying on the default java.io.tmpdir on multi-user hosts
Discovery Timeline
- 2026-10-06 - CVE-2026-106451 published to NVD
- 2026-10-07 - Last updated in NVD database
Technical Details for CVE-2026-106451
Vulnerability Analysis
The Native.load() routine extracts a bundled native shared library into the operating system temporary directory before invoking System.load(). The loader first calls File.createTempFile to atomically create a .lck lock file with a randomized suffix. It then derives the library path by stripping the .lck suffix and opens that derived path with FileOutputStream to write the embedded library bytes. The second step does not use exclusive-creation semantics, so the destination path is predictable and writable by any local principal with access to the shared directory.
An attacker who can enumerate the temporary directory can observe the newly created .lck file, compute the derived library path, and race the victim process by writing attacker-controlled shared-object content to that path. If the attacker wins the race before System.load() reads the file, the JVM loads adversary-supplied native code and executes it inside the Java process.
Root Cause
The root cause is the mismatch between the atomic creation of the .lck sentinel and the non-exclusive opening of the actual library file. createTempFile guarantees uniqueness for the lock, but reusing the derived name through FileOutputStream reintroduces a classic TOCTOU window on a predictable path in a shared directory.
Attack Vector
Exploitation requires local access to the host and the ability to write files to the shared java.io.tmpdir. The attacker monitors the directory for liblz4-java-*.lck files, derives the companion library path, and writes a malicious shared object before the victim JVM finishes its own write and load sequence. Hardened systems with restrictive directory permissions or sticky-bit protections may cause loading to fail and fall back to Java-only implementations instead of executing attacker code. Configurations that use a preinstalled system library, a private java.io.tmpdir, or Java-only implementations are not affected.
// Patch excerpt from net/jpountz/util/Native.java
// Source: https://github.com/yawkat/lz4-java/commit/7a48b7f6b8099b9dab6541e4ac2ee0979dc55aa3
/** Temporary libraries older than this are considered stale and removed by {@link #cleanupOldTempLibs()}. */
private static final long TEMP_LIB_MAX_AGE_MILLIS = 60 * 60 * 1000L;
private static void cleanupOldTempLibs() {
cleanupOldTempLibs(new File(System.getProperty("java.io.tmpdir")).getAbsoluteFile(), System.currentTimeMillis());
}
static void cleanupOldTempLibs(File dir, long now) {
// This also matches .lck files left behind by older versions.
File[] tempLibFiles = dir.listFiles(new FilenameFilter() {
private final String searchPattern = "liblz4-java-";
@Override
public boolean accept(File dir, String name) {
return name.startsWith(searchPattern);
}
});
if (tempLibFiles != null) {
for (File tempLibFile : tempLibFiles) {
// Libraries that are currently being extracted or loaded by another process are fresh.
if (now - tempLibFile.lastModified() > TEMP_LIB_MAX_AGE_MILLIS) {
// ... cleanup logic
}
}
}
}
Detection Methods for CVE-2026-106451
Indicators of Compromise
- Unexpected liblz4-java-* files in /tmp or the system temporary directory owned by non-service accounts.
- liblz4-java-* files whose modification timestamp precedes the corresponding .lck file created by the JVM.
- Native shared objects in the temp directory with SHA-256 hashes that do not match the bundled library distributed with the deployed lz4-java version.
Detection Strategies
- Hunt for processes other than the Java application creating or modifying files matching liblz4-java-* in shared temp directories.
- Alert on inotify, auditd, or EDR file-write telemetry showing non-JVM processes writing to paths that the JVM subsequently maps as executable memory via dlopen.
- Inventory running Java applications and flag any using net.jpountz.lz4:lz4-java or org.lz4:lz4-java versions prior to 1.11.4.
Monitoring Recommendations
- Enable Linux auditd rules on /tmp write syscalls (openat with O_WRONLY/O_CREAT) and correlate with mmap executable mappings in Java processes.
- Monitor filesystem events for races where a .lck file and its companion library are written by different user IDs within a short window.
- Collect SBOM data from CI/CD pipelines to continuously track application dependencies on vulnerable lz4-java releases.
How to Mitigate CVE-2026-106451
Immediate Actions Required
- Upgrade net.jpountz.lz4:lz4-java (and the maintained org.lz4:lz4-java fork) to version 1.11.4 or later across all Java services.
- Audit multi-tenant and shared Linux hosts for Java workloads that rely on the default java.io.tmpdir and restrict access to local accounts.
- Rotate any secrets handled by Java processes that may have loaded an attacker-controlled native library.
Patch Information
The fix is published in GitHub Release v1.11.4 and the corresponding commit 7a48b7f. Advisory details are available in GHSA-mcr4-qmvw-px4g. The patch tightens temp-file cleanup and the extraction sequence so that stale or attacker-planted liblz4-java-* artifacts are detected and removed before load.
Workarounds
- Set -Djava.io.tmpdir= to a private, per-service directory with 0700 permissions owned by the Java service account.
- Preinstall the LZ4 native library on the system library path and configure the application to load it instead of extracting the bundled copy.
- Where feasible, force the pure Java LZ4 implementation to bypass native loading entirely.
# Launch the JVM with an isolated temp directory to defeat the race
mkdir -p /var/lib/myapp/tmp
chown myapp:myapp /var/lib/myapp/tmp
chmod 700 /var/lib/myapp/tmp
java -Djava.io.tmpdir=/var/lib/myapp/tmp \
-jar /opt/myapp/app.jar
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

