RUSTSEC-2021-0048

    Dashboard / Vulnerabilities / RUSTSEC-2021-0048

    RUSTSEC-2021-0048

    Published: 19 Feb 2021Last Modified: 8 Nov 2023

    Summary: StackVec::extend can write out of bounds when size_hint is incorrect

    Details: `StackVec::extend` used the lower and upper bounds from an Iterator's `size_hint` to determine how many items to push into the stack based vector. If the `size_hint` implementation returned a lower bound that was larger than the upper bound, `StackVec` would write out of bounds and overwrite memory on the stack. As mentioned by the [size_hint](https://doc.rust-lang.org/std/iter/trait.Iterator.html#provided-methods) documentation, `size_hint` is mainly for optimization and incorrect implementations should not lead to memory safety issues.

    Affected packages

    Package

    Name: stackvector

    Purl: pkg:cargo/stackvector

    Affected ranges

    Type: SEMVER

    Events:

    Introduced- 0.0.0-0
    Fixed -1.0.9

    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-0048 | CVE-DB