CVE-2021-45680
vec-const attempts to construct a Vec from a pointer to a const slice
An issue was discovered in the vec-const crate before 2.0.0 for Rust. It tries to construct a Vec from a pointer to a const slice, leading to memory corruption.
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
- None
- Integrity
- None
- Availability
- High
Exploit likelihood
What each source reports
NVD Score used
7.5
An issue was discovered in the vec-const crate before 2.0.0 for Rust. It tries to construct a Vec from a pointer to a const slice, leading to memory corruption.
- Record
CVE-2021-45680- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - CVSS 2.0
- 5.0 Medium
AV:N/AC:L/Au:N/C:N/I:N/A:P - Weakness
- CWE-787
- Updated
- 2026-11-02
CVE List No score
An issue was discovered in the vec-const crate before 2.0.0 for Rust. It tries to construct a Vec from a pointer to a const slice, leading to memory corruption.
- Record
CVE-2021-45680- Updated
- 2026-11-02
EUVDEUVD-2022-0737 No score
An issue was discovered in the vec-const crate before 2.0.0 for Rust. It tries to construct a Vec from a pointer to a const slice, leading to memory corruption.
- Record
EUVD-2022-0737- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-x76r-966h-5qv9
7.5
Out-of-bounds Write in vec-const
An issue was discovered in the vec-const crate before 2.0.0 for Rust. It tries to construct a Vec from a pointer to a const slice, leading to memory corruption.
- Record
GHSA-x76r-966h-5qv9- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-787
- Updated
- 2026-11-02
GitHub AdvisoriesGHSA-jmwx-r3gq-qq3p No score
vec-const attempts to construct a Vec from a pointer to a const slice
Affected versions of this crate claimed to construct a const Vec with nonzero length and capacity, but that cannot be done because such a Vec requires a pointer from an allocator.
The implementation was later changed to just construct a std::borrow::Cow.
- Record
GHSA-jmwx-r3gq-qq3p- Updated
- 2026-11-02
OSVGHSA-x76r-966h-5qv9
7.5
Out-of-bounds Write in vec-const
An issue was discovered in the vec-const crate before 2.0.0 for Rust. It tries to construct a Vec from a pointer to a const slice, leading to memory corruption.
- Record
GHSA-x76r-966h-5qv9- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-787
- Updated
- 2026-11-02
OSVGHSA-jmwx-r3gq-qq3p No score
vec-const attempts to construct a Vec from a pointer to a const slice
Affected versions of this crate claimed to construct a const Vec with nonzero length and capacity, but that cannot be done because such a Vec requires a pointer from an allocator.
The implementation was later changed to just construct a std::borrow::Cow.
- Record
GHSA-jmwx-r3gq-qq3p- Updated
- 2026-11-02
OSVRUSTSEC-2021-0082 No score
vec-const attempts to construct a Vec from a pointer to a const slice
Affected versions of this crate claimed to construct a const Vec with nonzero length and capacity, but that cannot be done because such a Vec requires a pointer from an allocator.
The implementation was later changed to just construct a std::borrow::Cow.
- Record
RUSTSEC-2021-0082- Updated
- 2026-11-02
Affected products
Affected packages
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-45680 is a high vulnerability (CVSS 7.5) in Vec-const Project Vec-const, published August 14, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.09%, the 65th percentile. Fixed in vec-const 2.0.0.
References
rustsec.org/advisories/RUSTSEC-2021-0082.html
raw.githubusercontent.com/rustsec/advisory-db/main/crates/vec-const/RUSTSEC-2021-0082.md
github.com/Eolu/vec-const/issues/1
github.com/advisories/GHSA-jmwx-r3gq-qq3p
nvd.nist.gov/vuln/detail/CVE-2021-45680
github.com/advisories/GHSA-x76r-966h-5qv9
github.com/Eolu/vec-const
crates.io/crates/vec-const