CVE-2021-29939
Out of bounds write in stackvector
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- Low
- Integrity
- Low
- Availability
- Low
Exploit likelihood
What each source reports
NVD Score used
7.3
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.
- Record
CVE-2021-29939- CVSS 3.1
- 7.3 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L - CVSS 2.0
- 7.5 High
AV:N/AC:L/Au:N/C:P/I:P/A:P - Weakness
- CWE-787
- Updated
- 2026-11-02
CVE List No score
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.
- Record
CVE-2021-29939- Updated
- 2026-11-02
EUVDEUVD-2021-1659 No score
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.
- Record
EUVD-2021-1659- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-9frf-r7c7-j2vg
7.3
Out of bounds write in stackvector
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.
- Record
GHSA-9frf-r7c7-j2vg- CVSS 3.1
- 7.3 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L - Weakness
- CWE-787
- Updated
- 2026-11-02
OSV
7.3
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.
- Record
CVE-2021-29939- CVSS 3.1
- 7.3 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L - Updated
- 2026-11-02
OSVDEBIAN-CVE-2021-29939
7.3
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.
- Record
DEBIAN-CVE-2021-29939- CVSS 3.1
- 7.3 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L - Updated
- 2026-11-02
OSVGHSA-9frf-r7c7-j2vg
7.3
Out of bounds write in stackvector
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.
- Record
GHSA-9frf-r7c7-j2vg- CVSS 3.1
- 7.3 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L - Weakness
- CWE-787
- Updated
- 2026-11-02
OSVRUSTSEC-2021-0048
7.3
StackVec::extend can write out of bounds when size_hint is incorrect
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.
- Record
RUSTSEC-2021-0048- CVSS 3.1
- 7.3 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L - Updated
- 2026-11-02
OSVUBUNTU-CVE-2021-29939
7.3
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.
- Record
UBUNTU-CVE-2021-29939- CVSS 3.1
- 7.3 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L - Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
stackvectorcrates.io |
before 1.0.9 | 1.0.9 |
rust-stackvectorDebian:12 |
before 1.0.6-3 | 1.0.6-3 |
rust-stackvectorDebian:13 |
before 1.0.6-3 | 1.0.6-3 |
rust-stackvectorDebian:14 |
before 1.0.6-3 | 1.0.6-3 |
stackvectorcrates.io |
0.0.0-0 up to 1.0.9 | 1.0.9 |
rust-stackvectorUbuntu:20.04:LTS |
All versions, plus listed versions 1.0.6-2 |
None known |
rust-stackvectorUbuntu:22.04:LTS |
All versions, plus listed versions 1.0.6-31.1.1-1 |
None known |
rust-stackvectorUbuntu:24.04:LTS |
All versions, plus listed versions 1.1.1-1 |
None known |
rust-stackvectorUbuntu:25.10 |
All versions, plus listed versions 1.1.1-1 |
None known |
rust-stackvectorUbuntu:26.10 |
All versions, plus listed versions 1.1.1-1build1 |
None known |
rust-stackvectorUbuntu:26.04:LTS |
All versions, plus listed versions 1.1.1-11.1.1-1build1 |
None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2021-29939 is a high vulnerability (CVSS 7.3) in Stackvector Project Stackvector, published February 19, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.03%, the 63rd percentile. Fixed in stackvector 1.0.9.
References
rustsec.org/advisories/RUSTSEC-2021-0048.html
nvd.nist.gov/vuln/detail/CVE-2021-29939
github.com/Alexhuszagh/rust-stackvector/issues/2
github.com/advisories/GHSA-9frf-r7c7-j2vg
security-tracker.debian.org/tracker/CVE-2021-29939
github.com/Alexhuszagh/rust-stackvector
crates.io/crates/stackvector
ubuntu.com/security/CVE-2021-29939
cve.org/CVERecord?id=CVE-2021-29939