{"id":"GHSA-wm8x-php5-hvq6","aliases":["GHSA-wm8x-php5-hvq6","RUSTSEC-2023-0017"],"related":[],"kind":"vulnerability","state":"published","title":"Maligned causes incorrect deallocation","summary":"`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>`.\n\n[`GlobalAlloc::dealloc`](https://doc.rust-lang.org/std/alloc/trait.GlobalAlloc.html#tymethod.dealloc) requires that the `layout` argument must be the same layout that was used to allocate that block of memory.\n\nWhen deallocating, `Box` and `Vec` may not respect the specified alignment and can cause undefined behavior.","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"`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>`.\n\n[`GlobalAlloc::dealloc`](https://doc.rust-lang.org/std/alloc/trait.GlobalAlloc.html#tymethod.dealloc) requires that the `layout` argument must be the same layout that was used to allocate that block of memory.\n\nWhen deallocating, `Box` and `Vec` may not respect the specified alignment and can cause undefined behavior.","format":"markdown","source":"ghsa"}],"published":"2023-03-04T12:00:00.000Z","modified":"2023-11-08T04:23:53.984Z","severity":{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"},"severities":[{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"}],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"0.2.1"}],"ecosystem":"crates.io","package":"maligned","purl":"pkg:cargo/maligned","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected"}],"ecosystem":"crates.io","package":"maligned","purl":"pkg:cargo/maligned","source":"rustsec"}],"references":[{"url":"https://github.com/tylerhawkes/maligned/issues/5","tags":["report","web"],"sources":["ghsa","rustsec"]},{"url":"https://doc.rust-lang.org/std/alloc/trait.GlobalAlloc.html#tymethod.dealloc","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/tylerhawkes/maligned","tags":["package"],"sources":["ghsa"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2023-0017.html","tags":["advisory","web"],"sources":["ghsa","rustsec"]},{"url":"https://crates.io/crates/maligned","tags":["package"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-wm8x-php5-hvq6","url":"https://github.com/advisories/GHSA-wm8x-php5-hvq6","licence":"CC-BY-4.0","modified":"2023-11-08T04:23:53.984Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2023-0017","url":"https://rustsec.org/advisories/RUSTSEC-2023-0017.html","licence":"CC0-1.0","modified":"2023-11-08T04:23:53.984Z"}],"updatedAt":"2026-11-25T22:56:43.141Z"}