Every CVE Search/ Get API key

CVE-2021-45680

vec-const attempts to construct a Vec from a pointer to a const slice

7.5 HighFix available

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

1.09%Up 0.6 points since Dec 27, 2021
90%50%10%1%

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

Affected packages
PackageAffectedFixed
vec-const
crates.io
before 2.0.0
2.0.0
vec-const
crates.io
0.0.0-0 up to 2.0.0
2.0.0

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-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

MoveEnter Open