CVE-2021-29941
Out of bounds write in reorder
An issue was discovered in the reorder crate through 2021-02-24 for Rust. swap_index has an out-of-bounds write if an iterator returns a len() that is too small.
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 reorder crate through 2021-02-24 for Rust. swap_index has an out-of-bounds write if an iterator returns a len() that is too small.
- Record
CVE-2021-29941- 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 reorder crate through 2021-02-24 for Rust. swap_index has an out-of-bounds write if an iterator returns a len() that is too small.
- Record
CVE-2021-29941- Updated
- 2026-11-02
EUVDEUVD-2021-1545 No score
An issue was discovered in the reorder crate through 2021-02-24 for Rust. swap_index has an out-of-bounds write if an iterator returns a len() that is too small.
- Record
EUVD-2021-1545- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-3h87-v52r-p9rg
7.3
Out of bounds write in reorder
swap_index takes an iterator and swaps the items with their corresponding indexes. It reserves capacity and sets the length of the vector based on the .len() method of the iterator.
If the len() returned by the iterator is larger than the actual number of elements yielded, then swap_index creates a vector containing uninitialized members. If the len() returned by the iterator is smaller than the actual number of members yielded, then swap_index can write out of bounds past its allocated vector.
As noted by the Rust documentation, len() and size_hint() are primarily meant for optimization and incorrect values from their implementations should not lead to memory safety violations.
- Record
GHSA-3h87-v52r-p9rg- 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
OSVGHSA-3h87-v52r-p9rg
7.3
Out of bounds write in reorder
swap_index takes an iterator and swaps the items with their corresponding indexes. It reserves capacity and sets the length of the vector based on the .len() method of the iterator.
If the len() returned by the iterator is larger than the actual number of elements yielded, then swap_index creates a vector containing uninitialized members. If the len() returned by the iterator is smaller than the actual number of members yielded, then swap_index can write out of bounds past its allocated vector.
As noted by the Rust documentation, len() and size_hint() are primarily meant for optimization and incorrect values from their implementations should not lead to memory safety violations.
- Record
GHSA-3h87-v52r-p9rg- 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
OSVGHSA-jpwg-6gf5-5vh9
7.3
Out of bounds write in reorder
swap_index takes an iterator and swaps the items with their corresponding indexes. It reserves capacity and sets the length of the vector based on the .len() method of the iterator.
If the len() returned by the iterator is larger than the actual number of elements yielded, then swap_index creates a vector containing uninitialized members. If the len() returned by the iterator is smaller than the actual number of members yielded, then swap_index can write out of bounds past its allocated vector.
As noted by the Rust documentation, len() and size_hint() are primarily meant for optimization and incorrect values from their implementations should not lead to memory safety violations.
- Record
GHSA-jpwg-6gf5-5vh9- 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-0050
7.3
swap_index can write out of bounds and return uninitialized memory
swap_index takes an iterator and swaps the items with their corresponding
indexes. It reserves capacity and sets the length of the vector based on the
.len() method of the iterator.
If the len() returned by the iterator is larger than the actual number of
elements yielded, then swap_index creates a vector containing uninitialized
members. If the len() returned by the iterator is smaller than the actual
number of members yielded, then swap_index can write out of bounds past
its allocated vector.
As noted by the Rust documentation, len()
and size_hint() are primarily meant for optimization and incorrect values
from their implementations should not lead to memory safety violations.
Patch
A new version crate was pushed that marks this function as unsafe.
reorder = "1.1.0"
Previous versions have also been yanked from crates.io.
- Record
RUSTSEC-2021-0050- 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
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| 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-29941 is a high vulnerability (CVSS 7.3) in Reorder Project Reorder, published February 24, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.93%, the 60th percentile. Fixed in reorder 1.1.0.