lz4_flex's decompression can leak information from uninitialized memory or reused output bufferGHSA-vvp9-7p8x-rfvv
Fix: PSeitz/lz4_flex@055502eGHSA-vvp9-7p8x-rfvv is a CWE-201 vulnerability in lz4_flex. A fix is available for lz4_flex — see the affected versions and patch details below.
Exploitation Status
No confirmed exploitation observed yet
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-vvp9-7p8x-rfvv.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
lz4_flex🦀lz4_flexReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects crates.io packages — download data is not available via public APIs for these ecosystems.
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
unsafeimplementation (safe-decodefeature flag disabled, which is enabled by default): can leak content of uninitialized memory as decompressed result - decompressing LZ4 data into a reused, user-supplied
outputbuffer (affects thesafe-decodefeature 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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🦀crates.io | lz4_flex | all versions | 0.11.6cargo update -p lz4_flex --precise 0.11.6 |
| 🦀crates.io | lz4_flex | ≥ 0.12.0&&< 0.12.1 | 0.12.1cargo update -p lz4_flex --precise 0.12.1 |
Affected Products
lz4 flexpseitzDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for lz4_flex, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update lz4_flex to 0.11.6 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-vvp9-7p8x-rfvv is resolved across your whole dependency graph.
Workarounds
Stop feeding it untrusted input: reject or quarantine files and payloads from unverified sources until you can upgrade, restrict accepted formats to the ones you actually need, and run the parsing or decoding step in a least-privileged sandbox or short-lived worker so a crash or corrupted read cannot reach the rest of the process.
Frequently Asked Questions
Is GHSA-vvp9-7p8x-rfvv in your dependencies?
Find it across crates.io, including transitive dependencies.