Every CVE Search/ Get API key

CVE-2021-29939

Out of bounds write in stackvector

7.3 HighFix available

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

1.03%Up 0.6 points since Apr 14, 2021
90%50%10%1%

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 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
CVSS 2.0
7.5 HighAV: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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

Affected packages
PackageAffectedFixed
stackvector
crates.io
before 1.0.9
1.0.9
rust-stackvector
Debian:12
before 1.0.6-3
1.0.6-3
rust-stackvector
Debian:13
before 1.0.6-3
1.0.6-3
rust-stackvector
Debian:14
before 1.0.6-3
1.0.6-3
stackvector
crates.io
0.0.0-0 up to 1.0.9
1.0.9
rust-stackvector
Ubuntu:20.04:LTS
All versions, plus listed versions
1.0.6-2
None known
rust-stackvector
Ubuntu:22.04:LTS
All versions, plus listed versions
1.0.6-31.1.1-1
None known
rust-stackvector
Ubuntu:24.04:LTS
All versions, plus listed versions
1.1.1-1
None known
rust-stackvector
Ubuntu:25.10
All versions, plus listed versions
1.1.1-1
None known
rust-stackvector
Ubuntu:26.10
All versions, plus listed versions
1.1.1-1build1
None known
rust-stackvector
Ubuntu:26.04:LTS
All versions, plus listed versions
1.1.1-11.1.1-1build1
None known

History

History
RecordedChangedSources
aliasesEUVD
first indexedCVE 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

MoveEnter Open