GHSA-g23h-7vf9-xc25: Mimalloc Mimalloc Can Allocate Memory With Vulnerability

MODERATE
Published
Advisory Summary

GHSA-g23h-7vf9-xc25 is a MODERATE mimalloc can allocate memory with vulnerability (General Security Weakness) affecting Mimalloc libraries in the crates.io ecosystem. The issue involves mimalloc can allocate memory with bad alignment. Remediation is available by upgrading affected packages to version 0.1.39.

GHSA-g23h-7vf9-xc25 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-g23h-7vf9-xc25
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Mimalloc
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-g23h-7vf9-xc25

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

mimalloc fixed: 0.1.39
Upgrade mimalloc to 0.1.39
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 mimalloc

How to Check if You Are Affected

To determine whether your application is affected by GHSA-g23h-7vf9-xc25, inspect your project dependencies for Mimalloc:

inspect dependencies for mimalloc

Analyze the terminal output to locate any version of Mimalloc in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.1.39), 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 Mimalloc, 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

This crate depended on a promise regarding alignments made by the author of the mimalloc allocator to avoid using aligned allocation functions where possible for performance reasons. Since then, the mimalloc allocator's logic changed, making it break this promise. This caused this crate to return memory with an incorrect alignment for some allocations, particularly those with large alignments. The flaw was fixed by always using the aligned allocation functions.

GHSA-g23h-7vf9-xc25 Affected Mimalloc Versions

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

References

Frequently Asked Questions

What is GHSA-g23h-7vf9-xc25?
GHSA-g23h-7vf9-xc25 is a security vulnerability in Mimalloc involving Mimalloc Can Allocate Memory with Bad Alignment under General Security Weakness.
Which Mimalloc versions are affected?
Affected versions include releases prior to 0.1.39 across affected packages: mimalloc.
What version fixes GHSA-g23h-7vf9-xc25?
Upgrading to 0.1.39 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mimalloc affected?
Yes, mimalloc is affected in releases prior to 0.1.39. Upgrade your dependency to 0.1.39 or later.
What CWE is associated with GHSA-g23h-7vf9-xc25?
GHSA-g23h-7vf9-xc25 is classified under General Security Weakness.
How can I check crates.io dependencies for GHSA-g23h-7vf9-xc25?
Run the dependency tree command: 'inspect dependencies for mimalloc'. 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-g23h-7vf9-xc25",
  "modified" : "2024-11-12T21:21:36Z",
  "published" : "2024-11-12T21:21:36Z",
  "aliases" : [ ],
  "summary" : "Mimalloc Can Allocate Memory with Bad Alignment",
  "details" : "This crate depended on a promise regarding alignments made by the author of the mimalloc allocator to avoid using aligned allocation functions where possible for performance reasons.\nSince then, the mimalloc allocator's logic changed, making it break this promise.\nThis caused this crate to return memory with an incorrect alignment for some allocations, particularly those with large alignments.\nThe flaw was fixed by always using the aligned allocation functions.\n",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:P"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "mimalloc"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.1.39"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/purpleprotocol/mimalloc_rust/issues/87"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/purpleprotocol/mimalloc_rust"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2022-0094.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-11-12T21:21:36Z",
    "nvd_published_at" : null
  }
}