GHSA-5m39-wx2q-mxg3: Invalid use of `mem :uninitialized` Causes `use-of-uninitialized-value` Vulnerability

MODERATE
Published
Advisory Summary

GHSA-5m39-wx2q-mxg3 is a MODERATE :uninitialized` causes `use-of-uninitialized-value` vulnerability (General Security Weakness) affecting Invalid use of `mem libraries in the crates.io ecosystem. The issue involves :uninitialized` causes `use-of-uninitialized-value`. Remediation is available by upgrading affected packages to version 0.3.2.

GHSA-5m39-wx2q-mxg3 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-5m39-wx2q-mxg3
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Invalid use of `mem
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-5m39-wx2q-mxg3

To remediate this vulnerability, upgrade all affected Invalid use of `mem dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

lzf fixed: 0.3.2
Upgrade lzf to 0.3.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for lzf

How to Check if You Are Affected

To determine whether your application is affected by GHSA-5m39-wx2q-mxg3, inspect your project dependencies for Invalid use of `mem:

inspect dependencies for lzf

Analyze the terminal output to locate any version of Invalid use of `mem in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.3.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In Invalid use of `mem, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

The compression and decompression function used `mem:uninitialized` to create an array of uninitialized values, to later write values into it. This later leads to reads from uninitialized memory. The flaw was corrected in commit b633bf265e41c60dfce3be7eac4e4dd5e18d06cf by using a heap-allocated `Vec` and removing out use of `mem::uninitialized`. The fix was released in v0.3.2 and v1.0.0 Subsequently, the crate was deprecated and its use is discouraged.

GHSA-5m39-wx2q-mxg3 Affected Invalid use of `mem Versions

1 component(s)
Fixed Versions:
0.3.2
Product / Package Ecosystem Affected Versions Fixed Version
lzf
crates.io
< 0.3.2
0.3.2

References

Frequently Asked Questions

What is GHSA-5m39-wx2q-mxg3?
GHSA-5m39-wx2q-mxg3 is a security vulnerability in Invalid use of `mem involving :uninitialized` causes `use-of-uninitialized-value` under General Security Weakness.
Which Invalid use of `mem versions are affected?
Affected versions include releases prior to 0.3.2 across affected packages: lzf.
What version fixes GHSA-5m39-wx2q-mxg3?
Upgrading to 0.3.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is lzf affected?
Yes, lzf is affected in releases prior to 0.3.2. Upgrade your dependency to 0.3.2 or later.
What CWE is associated with GHSA-5m39-wx2q-mxg3?
GHSA-5m39-wx2q-mxg3 is classified under General Security Weakness.
How can I check crates.io dependencies for GHSA-5m39-wx2q-mxg3?
Run the dependency tree command: 'inspect dependencies for lzf'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-5m39-wx2q-mxg3",
  "modified" : "2022-11-08T21:56:43Z",
  "published" : "2022-11-08T21:42:06Z",
  "aliases" : [ ],
  "summary" : "Invalid use of `mem::uninitialized` causes `use-of-uninitialized-value`",
  "details" : "The compression and decompression function used `mem:uninitialized` to create an array of uninitialized values, to later write values into it. This later leads to reads from uninitialized memory.\n\nThe flaw was corrected in commit b633bf265e41c60dfce3be7eac4e4dd5e18d06cf by using a heap-allocated `Vec` and removing out use of `mem::uninitialized`. The fix was released in v0.3.2 and v1.0.0\n\nSubsequently, the crate was deprecated and its use is discouraged.\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "lzf"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.3.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/badboy/lzf-rs/issues/9"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/badboy/lzf-rs/commit/b633bf265e41c60dfce3be7eac4e4dd5e18d06cf"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/badboy/lzf-rs"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2022-0067.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-11-08T21:42:06Z",
    "nvd_published_at" : null
  }
}