rustsec-2026-0041
Vulnerability from osv_rustsec
Published
2026-03-17 12:00
Modified
2026-03-17 16:08
Summary
Decompressing invalid data can leak information from uninitialized memory or reused output buffer
Details

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.


{
  "affected": [
    {
      "database_specific": {
        "categories": [
          "memory-exposure"
        ],
        "cvss": "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",
        "informational": null
      },
      "ecosystem_specific": {
        "affected_functions": null,
        "affects": {
          "arch": [],
          "functions": [
            "lz4_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"
          ],
          "os": []
        }
      },
      "package": {
        "ecosystem": "crates.io",
        "name": "lz4_flex",
        "purl": "pkg:cargo/lz4_flex"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0.0.0-0"
            },
            {
              "fixed": "0.11.6"
            },
            {
              "introduced": "0.12.0"
            },
            {
              "fixed": "0.12.1"
            }
          ],
          "type": "SEMVER"
        }
      ],
      "versions": []
    }
  ],
  "aliases": [
    "CVE-2026-32829",
    "GHSA-vvp9-7p8x-rfvv"
  ],
  "database_specific": {
    "license": "CC0-1.0"
  },
  "details": "Decompressing invalid LZ4 data with the block API can leak data from uninitialized memory,\nor leak content from previous decompression operations when reusing an output buffer.\n\nThe LZ4 block format defines a \"match copy operation\" which duplicates previously written\ndata or data from a user-supplied dict. The position of that data is defined by an _offset_.\n`lz4_flex` did not properly validate _offset_ values, causing it to copy data from outside\nthe initialized portion of the output buffer.\n\nTwo scenarios are affected:\n\n- Decompressing with the `unsafe` implementation (`safe-decode` feature flag disabled, which\n  is the default): can leak content of uninitialized memory as part of the decompressed result.\n- Decompressing into a reused, user-supplied output buffer (also affects `safe-decode`): can\n  leak the previous contents of the output buffer as part of the decompressed result.\n\nOnly the block-based APIs are affected. All frame APIs are unaffected.\n\nThe flaw was corrected in versions 0.11.6 and 0.12.1 by properly validating offset values\nduring decompression.\n\nIf upgrading is not possible, the issue can be mitigated by zeroing the output buffer before\neach call to the affected functions and enabling the `safe-decode` feature flag.",
  "id": "RUSTSEC-2026-0041",
  "modified": "2026-03-17T16:08:45Z",
  "published": "2026-03-17T12:00:00Z",
  "references": [
    {
      "type": "PACKAGE",
      "url": "https://crates.io/crates/lz4_flex"
    },
    {
      "type": "ADVISORY",
      "url": "https://rustsec.org/advisories/RUSTSEC-2026-0041.html"
    }
  ],
  "related": [],
  "severity": [
    {
      "score": "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",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Decompressing invalid data can leak information from uninitialized memory or reused output buffer"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…