CVE-2026-106451: yawkat LZ4 Java: Native library extraction to a shared temporary directory is vulnerable to file replacement by another local user
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.
Published Oct 7, 2026
Affected packages
at.yawk.lz4:lz4-java
- Ecosystem
- Maven
- Affected
- <= 1.11.3
- Fixed in
- 1.11.4
- Check
mvn dependency:tree -Dincludes=at.yawk.lz4:lz4-java
org.lz4:lz4-java
- Ecosystem
- Maven
- Affected
- >= 1.7.0, <= 1.8.1
- Fixed in
- No patched version yet
- Check
mvn dependency:tree -Dincludes=org.lz4:lz4-java
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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
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.
References
- https://github.com/yawkat/lz4-java/security/advisories/GHSA-mcr4-qmvw-px4g
- https://nvd.nist.gov/vuln/detail/CVE-2026-106451
- https://github.com/yawkat/lz4-java/commit/7a48b7f6b8099b9dab6541e4ac2ee0979dc55aa3
- https://github.com/yawkat/lz4-java/releases/tag/v1.11.4
- https://github.com/advisories/GHSA-mcr4-qmvw-px4g
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Maven vulnerabilities
All Maven entriesCVE-2026-106449
yawkat LZ4 Java: LZ4BlockInputStream with stopOnEmptyBlock=false recurses once per empty block, causing StackOverflowError
low3.7No fixOct 7, 2026CVE-2026-106450
yawkat LZ4 Java: LZ4FrameInputStream reallocates block buffers for every frame, allowing CPU and GC amplification from small inputs
medium5.3No fixOct 7, 2026CVE-2026-106452
yawkat LZ4 Java: LZ4BlockInputStream allocates an unvalidated compressed length from the stream header
medium5.3No fixOct 7, 2026CVE-2026-106453
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
medium5.3No fixOct 7, 2026CVE-2026-59949
LZ4 Java: Native XXHash implementations can crash the JVM when passed invalid byte array ranges
medium6.5No fixJul 24, 2026CVE-2025-66566
yawkat LZ4 Java has a possible information leak in Java safe decompressor
high8.2No fixDec 5, 2025
