GHSA-g23h-7vf9-xc25 Mimalloc Can Allocate Memory with Bad Alignment
Not scored
Published
Check this codebase for GHSA-g23h-7vf9-xc25 and fix it if it is affected.
What it is: GHSA-g23h-7vf9-xc25 is a memory corruption vulnerability in mimalloc, published on 23 Nov 2022.
Exploitation: There is no known exploitation of GHSA-g23h-7vf9-xc25 in the wild and no public exploit code.
Affected packages and fixed versions:
- mimalloc (crates.io): affected all versions; fixed in 0.1.39
- mimalloc (crates.io): affected all versions; fixed in 0.1.39
- mimalloc (crates.io): affected from 0.0.0-0; fixed in 0.1.39
Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.
Reference: https://insights.sbomify.com/GHSA-g23h-7vf9-xc25/ (Markdown: https://insights.sbomify.com/GHSA-g23h-7vf9-xc25/index.md)
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.
| Package | Affected | Fixed in |
|---|---|---|
mimalloc crates.io | All versions | 0.1.39 |
mimalloc crates.io | All versions | 0.1.39 |
mimalloc crates.io | From 0.0.0-0 | 0.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.