GitHub Advisoryadvisory · crates.io

GHSA-9frf-r7c7-j2vg Out of bounds write in stackvector

HIGH Published 2021-08-25 Modified 2023-06-13 Official page ↗
Aliases
CVE-2021-29939
Ecosystem
crates.io
Packages
stackvector
Severity
High
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
Weaknesses
CWE-787
Reviewed
2021-08-19

Affected packages

• crates.io stackvector: < 1.0.9 → fixed in 1.0.9

Description

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.

Related

Alias · CVE (1)

  • CVE-2021-29939 An issue was discovered in the stackvector crate through 2021-02-19 for Rust. vulnerability

Weakness · CWE (1)

  • CWE-787 Out-of-bounds Write weakness

References