lz4_flex's decompression can leak information from uninitialized memory or reused output buffer

Description

Summary

Decompressing invalid LZ4 data can leak data from uninitialized memory, or can leak content from previous decompression operations when reusing an output buffer.

Details

The LZ4 block format defines a "match copy operation" which duplicates previously written data or data from the user-supplied dict. The position of that data is defined by an offset. The data is copied within the output buffer from the offset to the current output position.
However, lz4_flex did not properly detect invalid and out-of-bounds offset values properly, causing it to copy uninitialized data from the output buffer.

Only the block based API functions are affected:
lz4_flex::block::{decompress_into, decompress_into_with_dict}

When safe-decode is disabled additionally these functions are affected
lz4_flex::block::{decompress, decompress_with_dict, decompress_size_prepended, decompress_size_prepended_with_dict}

All frame APIs are not affected.

There are two affected use cases:
- decompressing LZ4 data with the unsafe implementation (safe-decode feature flag disabled, which is enabled by default):
can leak content of uninitialized memory as decompressed result
- decompressing LZ4 data into a reused, user-supplied output buffer (affects the safe-decode feature as well):
can leak the previous contents of the output buffer as decompressed result

Impact

Leakage of data from uninitialized memory or content from previous decompression operations, possibly revealing sensitive information and secrets.

Mitigation

lz4_flex 0.12.1 and 0.11.6 fixes this issue without requiring changes in user code.

If you cannot upgrade, you can mitigate this vulnerability by zeroing the output buffer before calling block::decompress_into or block::decompress_into_with_dict (only block based API is affected, frame API is not affected). Additionally the the safe-decode feature flag should be enabled.

Basic information

Type
reviewed
Severity
high
Advisory on GitHub
Open advisory ↗
Repository advisory
Open repository advisory ↗
Source code
Browse source ↗
Published (advisory)
2026-03-16 20:48:08 UTC
Updated
2026-03-20 21:18:56 UTC
GitHub reviewed
2026-03-16 20:48:08 UTC
NVD published
2026-03-19

EPSS Score

Score Percentile
0.01% 2.33%

CVSS Scores

Base score Version Severity Vector
8.2 4.0
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network.
Attack complexity (AC:L)
Exploitation conditions are straightforward and stable.
Attack requirements (AT:P)
Additional preconditions must be present for exploitation.
Privileges required (PR:N)
No privileges are required.
User interaction (UI:N)
No user interaction is required.
Vulnerable system confidentiality impact (VC:H)
High confidentiality impact on the vulnerable system.
Vulnerable system integrity impact (VI:N)
No integrity impact on the vulnerable system.
Vulnerable system availability impact (VA:N)
No availability impact on the vulnerable system.
Subsequent system confidentiality impact (SC:N)
No confidentiality impact on subsequent systems.
Subsequent system integrity impact (SI:N)
No integrity impact on subsequent systems.
Subsequent system availability impact (SA:N)
No availability impact on subsequent systems.

Identifiers

CWEs

CWE id Name
CWE-201 Insertion of Sensitive Information Into Sent Data
CWE-823 Use of Out-of-range Pointer Offset

Credits

  • Marcono1234 (finder)

Affected packages (2)

Vulnerable version ranges and first patched releases as published by GitHub.

Ecosystem Package Vulnerable range First patched Vulnerable functions
rust lz4_flex < 0.11.6 0.11.6
rust lz4_flex >= 0.12.0, < 0.12.1 0.12.1

References

cvelogic Threat Intelligence