RUSTSEC-2021-0048

Source
https://rustsec.org/advisories/RUSTSEC-2021-0048
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2021-0048.json
JSON Data
https://api.osv.dev/v1/vulns/RUSTSEC-2021-0048
Aliases
Published
2021-02-19T12:00:00Z
Modified
2023-11-08T04:05:44.063920Z
Severity
  • 7.3 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L CVSS Calculator
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 documentation, size_hint is mainly for optimization and incorrect implementations should not lead to memory safety issues.

Database specific
{
    "license": "CC0-1.0"
}
References

Affected packages

crates.io / stackvector

Package

Affected ranges

Type
SEMVER
Events
Introduced
0.0.0-0
Fixed
1.0.9

Ecosystem specific

{
    "affected_functions": null,
    "affects": {
        "os": [],
        "functions": [],
        "arch": []
    }
}

Database specific

{
    "cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L",
    "informational": null,
    "categories": [
        "memory-corruption"
    ]
}