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 package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| stackvector (crates.io) | before 1.0.9, from 0.0.0-0 before 1.0.9 | GitHub Advisory Database, RustSec Advisory Database |
| stackvector_project stackvector | before 1.0.9 | NVD |
All scores
| GitHub | 7.3high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L |
| RustSec Advisory Database | 7.3high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L |
| NVD | 7.3high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L |
| NVD | 7.5high CVSS:2.0 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
Classification
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
| https://rustsec.org/advisories/RUSTSEC-2021-0048.html | advisory, exploit, vendor-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-29939 | advisory | |
| https://github.com/Alexhuszagh/rust-stackvector/issues/2 | report, web | |
| https://github.com/Alexhuszagh/rust-stackvector | package | |
| https://crates.io/crates/stackvector | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-29939 changed 2024-11-19 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-9frf-r7c7-j2vg changed 2023-11-08 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2021-0048 changed 2023-11-08 | CC0-1.0 |
| NVD | CVE-2021-29939 changed 2026-06-17 | Public domain |