{"id":"GHSA-wm8x-php5-hvq6","aliases":["RUSTSEC-2023-0017"],"status":"published","title":"Maligned causes incorrect deallocation","description":"`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\u003cT\u003e`.\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.","facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":false},"published":"2023-03-04T12:00:00Z","modified":"2023-11-08T04:23:53Z","affected":[{"source":"ghsa","ecosystem":"crates.io","package":"maligned","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"0.2.1"}]}]},{"source":"osv","ecosystem":"crates.io","package":"maligned","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"last_affected":"0.2.1"}]}]},{"source":"osv","ecosystem":"crates.io","package":"maligned","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"}]}]}],"references":[{"url":"https://github.com/tylerhawkes/maligned/issues/5","tags":["web","report"]},{"url":"https://doc.rust-lang.org/std/alloc/trait.GlobalAlloc.html#tymethod.dealloc","tags":["web"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2023-0017.html","tags":["web","advisory"]},{"url":"https://github.com/advisories/GHSA-wm8x-php5-hvq6"},{"url":"https://github.com/tylerhawkes/maligned","tags":["package"]},{"url":"https://crates.io/crates/maligned","tags":["package"]}],"sources":{"ghsa":[{"id":"GHSA-wm8x-php5-hvq6","title":"Maligned causes incorrect deallocation","description":"`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\u003cT\u003e`.\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.\n","status":"published","published":"2023-03-07T20:13:19Z","modified":"2023-03-07T20:13:20Z","updated_at":"2026-11-02T14:36:47.279442Z"}],"osv":[{"id":"GHSA-wm8x-php5-hvq6","title":"Maligned causes incorrect deallocation","description":"`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\u003cT\u003e`.\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.\n","status":"published","published":"2023-03-07T20:13:19Z","modified":"2023-11-08T04:23:53.984745Z","updated_at":"2026-11-02T15:46:58.767335Z"},{"id":"RUSTSEC-2023-0017","title":"`maligned::align_first` causes incorrect deallocation","description":"`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\u003cT\u003e`.\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.","status":"published","published":"2023-03-04T12:00:00Z","modified":"2023-11-08T04:23:53.984745Z","updated_at":"2026-11-02T15:53:39.971022Z"}]}}
