Description

A high-severity vulnerability has been discovered in lz4-java, a widely used Java library implementing the LZ4 compression algorithm. Tracked as CVE-2025-66566 with a CVSS score of 8.2, this flaw poses a significant risk to data confidentiality. The issue allows attackers to craft malicious compressed input that causes the decompressor to read from uninitialized regions of the output buffer. If those regions contain leftover data from previous operations, sensitive information—such as passwords, cryptographic keys, or user data—may be unintentionally exposed. The vulnerability arises from insufficient clearing of output buffers in Java-based decompressor implementations used in lz4-java 1.10.0 and earlier. The LZ4 algorithm relies on fast repetition of previously decompressed data, but the Java implementation contains a blind spot that allows manipulated input to trigger the copying of memory that was never sanitized. Applications that reuse output buffers to optimize memory usage are particularly at risk, as “dirty” buffer regions may contain sensitive remnants from earlier workloads. Not all implementations are affected. JNI-based decompressors remain safe, but users must verify which factory methods their applications call. Pure Java paths—safeInstance() and unsafeInstance()—are fully vulnerable. In addition, fastestInstance() may unintentionally fall back to the vulnerable Java implementation when JNI is unavailable. Even nativeInstance().fastDecompressor() is impacted due to its reliance on vulnerable logic since version 1.8.1. The maintainers have released lz4-java 1.10.1, which resolves the issue without requiring changes to application code. If upgrading is not immediately possible, developers can mitigate the risk by explicitly zeroing the output buffer before each decompression operation, ensuring no residual data is exposed.