Vulnerability in lz4 package: Out-of-Bound Read in LZ4_decompress_safe_partial

Kernel Updated 02 Oct 2025

Summary

24/04/2022
N/A
No i
Unrated
Not published

GSD-2022-1001677: lz4: fix LZ4_decompress_safe_partial read out of bound. Affects Kernel versions < 9fb8bc6cfc58773ce95414e11c9ccc8fc6ac4927. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The lz4 package is a compression library that provides fast compression and decompression algorithms. It is commonly used in various applications and systems to reduce the size of data. However, a vulnerability has been discovered in the LZ4_decompress_safe_partial function of the lz4 package, which could lead to an out-of-bound read. This vulnerability can potentially be exploited by an attacker to read sensitive information from memory or cause a denial-of-service condition.

Vulnerability Detail

The vulnerability in the lz4 package arises from a flaw in the LZ4_decompress_safe_partial function. When decompressing compressed data, the function fails to properly validate the input, leading to a read operation beyond the bounds of the input buffer. This can result in the disclosure of sensitive information or a crash of the application or system. The impact and attack plausibility of this vulnerability have not been proven yet, but it is important to address it to ensure the security and stability of systems using the lz4 package.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, if updating the lz4 package is not immediately feasible, developers can consider implementing input validation checks before using the LZ4_decompress_safe_partial function. By ensuring that the input data is within the expected bounds, the risk of triggering the out-of-bound read vulnerability can be mitigated. Here is an example of how to perform input validation in C:

size_t compressed_size = ...; // size of the compressed data
size_t decompressed_size = ...; // expected size of the decompressed data

if (compressed_size > MAX_COMPRESSED_SIZE || decompressed_size > MAX_DECOMPRESSED_SIZE) {
  // Handle error or return
}

// Proceed with decompression

Conclusion

In conclusion, the lz4 package is vulnerable to an out-of-bound read issue in the LZ4_decompress_safe_partial function. This vulnerability can potentially be exploited to read sensitive information or cause a denial-of-service condition. It is recommended to update the lz4 package to version v5.15.34 or later to fix this vulnerability. In the meantime, implementing input validation checks can serve as a temporary workaround. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for Kernel →

Share this vulnerability

FAQ

The impact of this vulnerability can vary depending on the specific application or system using the lz4 package. It could potentially allow an attacker to read sensitive information from memory or cause a denial-of-service condition by crashing the application or system.

You can use the Vulert Playground at Vulert Scanner to check if your application is affected by this vulnerability. The Vulert Playground allows you to analyze your application's manifest file, such as package-lock.json, and provides real-time monitoring and alerts for open-source vulnerabilities.

Yes, a fix for this vulnerability is available in the Linux Kernel version v5.15.34. It is recommended to update the lz4 package to this version or later to ensure the vulnerability is addressed.

A temporary workaround for this vulnerability is to implement input validation checks before using the LZ4_decompress_safe_partial function. By validating the input data to ensure it is within the expected bounds, the risk of triggering the out-of-bound read vulnerability can be mitigated.

You can find more information about this vulnerability in the GSD-2022-1001677 entry of the GSD database maintained by the Cloud Security Alliance. The entry provides details about the vulnerability, including the fix commit and relevant references.

Related vulnerabilities

Recent vulnerabilities recorded for Kernel.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback