RUSTSEC-2021-0032

    Dashboard / Vulnerabilities / RUSTSEC-2021-0032

    RUSTSEC-2021-0032

    Published: 1 Mar 2021Last Modified: 8 Nov 2023

    Summary: Deserializing an array can drop uninitialized memory on panic

    Details: The `read_bytes_default_le` function for `[T; n]` arrays, used to deserialize arrays of `T` from bytes created a `[T; n]` array with `std::mem::uninitialized` and then called `T`'s deserialization method. If `T`'s deserialization method panicked, the uninitialized memory could drop invalid objects. This flaw was corrected in `a535678` by removing the unsafe block and using a `.map` function to deserialize each element of the array instead.

    Affected packages

    Package

    Name: byte_struct

    Purl: pkg:cargo/byte_struct

    Affected ranges

    Type: SEMVER

    Events:

    Introduced- 0.0.0-0
    Fixed -0.6.1

    Affected versions

    Common Vulnerability Scoring System

    Attack Vector
    Network
    Adjacent
    Local
    Physical
    Privileges Required
    None
    Low
    High
    User Interaction
    None
    Required
    Scope
    Unchanged
    Changed
    Confidentiality
    None
    Low
    High
    Integrity
    None
    Low
    High
    Availability
    None
    Low
    High
    RUSTSEC-2021-0032 | CVE-DB