Email me

Rust advisories / lz4_flex

Vulnerability HighRUSTSEC-2026-0041 · lz4_flex

RUSTSEC-2026-0041: Decompressing invalid data can leak information from uninitialized memory or reused output buffer

Short answerA security vulnerability in the lz4_flex crate: Decompressing invalid data can leak information from uninitialized memory or reused output buffer. GitHub rates it High. Fixed in 0.11.6, 0.12.1: update to a fixed version.

Cratelz4_flex
TypeVulnerability (memory-exposure)
Affected versionsBefore 0.11.6; from 0.12.0 before 0.12.1.
Fixed in0.11.6, 0.12.1
SeverityHigh (GitHub rating)
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
Published2026-03-17
Last changed2026-03-17
Also known asCVE-2026-32829, GHSA-vvp9-7p8x-rfvv
Affected functionslz4_flex::block::decompress, lz4_flex::block::decompress_into, lz4_flex::block::decompress_into_with_dict, lz4_flex::block::decompress_size_prepended, lz4_flex::block::decompress_size_prepended_with_dict, lz4_flex::block::decompress_with_dict

What to do

  1. See which version you have: cargo tree -i lz4_flex (it also shows which of your dependencies pulls it in).
  2. Update within your version requirement: cargo update -p lz4_flex. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for example lz4_flex = "0.12.1") or update the dependency that pulls it in.
  3. Check again with cargo audit, or paste your Cargo.lock into our Cargo.toml checker.

Details from the advisory

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

The LZ4 block format defines a "match copy operation" which duplicates previously written data or data from a user-supplied dict. The position of that data is defined by an _offset_. lz4_flex did not properly validate _offset_ values, causing it to copy data from outside the initialized portion of the output buffer.

Two scenarios are affected:

  • Decompressing with the unsafe implementation (safe-decode feature flag disabled, which is the default): can leak content of uninitialized memory as part of the decompressed result.
  • Decompressing into a reused, user-supplied output buffer (also affects safe-decode): can leak the previous contents of the output buffer as part of the decompressed result.

Only the block-based APIs are affected. All frame APIs are unaffected.

The flaw was corrected in versions 0.11.6 and 0.12.1 by properly validating offset values during decompression.

If upgrading is not possible, the issue can be mitigated by zeroing the output buffer before each call to the affected functions and enabling the safe-decode feature flag.

References

From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.

Up next

Are you affected?Check your whole dependency treePaste Cargo.lock: every advisory, for your exact versions.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ