CVE-2026-59949
Description
A flaw was found in lz4-java. Insufficient validation of byte array arguments in its Java Native Interface (JNI)-based XXHash implementations allows an attacker to crash the Java Virtual Machine (JVM) by providing invalid input. This can lead to a denial of service, making the affected application unavailable. In some cases, this flaw could also lead to the exposure of in-process data due to out-of-bounds memory reads.
Statement
A flaw was found in the lz4-java library's JNI-backed XXHash implementations. The native XXHash methods (hash32, hash64, streamingHash32, streamingHash64) obtained via XXHashFactory.nativeInstance() do not properly validate byte array arguments, offsets, and lengths before passing them to native code. An attacker able to control these parameters can pass null arrays or out-of-bounds ranges, causing a fatal JVM crash (denial of service) and potentially reading process memory beyond array bounds. The Java-based implementations obtained via XXHashFactory.safeInstance() or XXHashFactory.fastestJavaInstance() are not affected.
Mitigation
Use XXHashFactory.safeInstance() or XXHashFactory.fastestJavaInstance() instead of XXHashFactory.nativeInstance() to avoid the JNI boundary. Alternatively, validate that arrays are non-null and that offset and length parameters describe a range fully contained in the array before calling native XXHash methods.
Understanding the Weakness (CWE)
Confidentiality
Technical Impact: Read Memory
An attacker could get secret values such as cryptographic keys, PII, memory addresses, or other information that could be used in additional attacks.
Confidentiality
Technical Impact: Bypass Protection Mechanism
Out-of-bounds memory could contain memory addresses or other information that can be used to bypass ASLR and other protection mechanisms in order to improve the reliability of exploiting a separate weakness for code execution.
Availability
Technical Impact: DoS: Crash, Exit, or Restart
An attacker could cause a segmentation fault or crash by causing memory to be read outside of the bounds of the buffer. This is especially likely when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string.
Other
Technical Impact: Varies by Context
The read operation could produce other undefined or unexpected results.
Frequently Asked Questions
Not sure what something means? Check out our Security Glossary.
Want to get errata notifications? Sign up here.