GHSA-g23h-7vf9-xc25 Mimalloc Can Allocate Memory with Bad Alignment

Not scored Published

Incorrect memory alignment in mimalloc bindings can lead to memory corruption, crashes, or potential code execution in Rust applications.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Not stated
Victim action needed
Not needed
Fix
Available

What is GHSA-g23h-7vf9-xc25?

GHSA-g23h-7vf9-xc25 is a memory corruption vulnerability in mimalloc, published on 23 Nov 2022.

Official description

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.

Which versions are affected by GHSA-g23h-7vf9-xc25?

3 open source packages ship an affected version, including mimalloc.

PackageAffectedFixed in
mimalloc crates.ioAll versions0.1.39
mimalloc crates.ioAll versions0.1.39
mimalloc crates.ioFrom 0.0.0-00.1.39

How do I fix GHSA-g23h-7vf9-xc25?

Upgrade mimalloc to 0.1.39 or later.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is GHSA-g23h-7vf9-xc25 being exploited?

There is no known exploitation of GHSA-g23h-7vf9-xc25 in the wild and no public exploit code.

Sources

Also known as RUSTSEC-2022-0094.

Is GHSA-g23h-7vf9-xc25 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free