GHSA-wm8x-php5-hvq6
medium
Maligned causes incorrect deallocation
- Severity
- medium rating by GitHub
- Published
- Last changed
- Also known as
- RUSTSEC-2023-0017
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<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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| maligned (crates.io) | up to 0.2.1, from 0.0.0-0 | GitHub Advisory Database, RustSec Advisory Database |
References
Sources
| Source | Record | Licence |
|---|---|---|
| GitHub Advisory Database | GHSA-wm8x-php5-hvq6 changed 2023-11-08 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2023-0017 changed 2023-11-08 | CC0-1.0 |