RUSTSEC-2023-0017
MEDIUMMaligned causes incorrect deallocation
maligned::align_first manually allocates with an alignment larger than T, and then uses Vec::from_raw_parts on that allocation to get a Vec<T>.
GlobalAlloc::dealloc requires that the layout argument must be the same layout that was used to allocate that block of memory.
When deallocating, Box and Vec may not respect the specified alignment and can cause undefined behavior.
- Published
- 4 Mar 2023
- Last modified
- 8 Nov 2023
- Also known as
- GHSA-wm8x-php5-hvq6
- Sources
- OSV GHSA-wm8x-php5-hvq6JSONOSVJSON
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| OSV | crates.io | maligned | <= 0.2.1 | |
| OSV | crates.io | maligned | >= 0.0.0-0 |
References
- https://github.com/tylerhawkes/maligned/issues/5 · WEB, REPORT
- https://doc.rust-lang.org/std/alloc/trait.GlobalAlloc.html#tymethod.dealloc · WEB
- https://github.com/tylerhawkes/maligned · PACKAGE
- https://rustsec.org/advisories/RUSTSEC-2023-0017.html · WEB, ADVISORY
- https://crates.io/crates/maligned · PACKAGE
History
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 4 Mar 2023)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 7 Mar 2023)