CVE-2021-29939
JSON

7.3high

Out of bounds write in stackvector

Severity
7.3high CVSS:3.1 by NVD
Exploit likelihood
1.03% (higher than 64% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
mitre
Also known as
GHSA-9frf-r7c7-j2vgRUSTSEC-2021-0048

Description

An issue was discovered in the stackvector crate through 2021-02-19 for Rust. There is an out-of-bounds write in StackVec::extend if size_hint provides certain anomalous data.

Affected

Product or packageVersionsReported by
Unspecified productn/aCVE List
stackvector (crates.io)before 1.0.9, from 0.0.0-0 before 1.0.9GitHub Advisory Database, RustSec Advisory Database
stackvector_project stackvectorbefore 1.0.9NVD

All scores

GitHub7.3high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
RustSec Advisory Database7.3high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
NVD7.3high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
NVD7.5high CVSS:2.0AV:N/AC:L/Au:N/C:P/I:P/A:P

Classification

CWE-787

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

An issue was discovered in the stackvector crate through 2021-02-19 for Rust. There is an out-of-bounds write in StackVec::extend if size_hint provides certain anomalous data.

GitHub Advisory Database

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.

RustSec Advisory Database

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.

NVD (es)

Se detectó un problema en la crate stackvector hasta el 19-02-2021 para Rust. Se presenta una escritura fuera de límites en la función StackVec::extend si size_hint proporciona determinados datos anómalos.

References

Sources

SourceRecordLicence
CVE ListCVE-2021-29939 changed 2024-11-19CVE Terms of Use
GitHub Advisory DatabaseGHSA-9frf-r7c7-j2vg changed 2023-11-08CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2021-0048 changed 2023-11-08CC0-1.0
NVDCVE-2021-29939 changed 2026-06-17Public domain