CVE-2021-45680
HIGH 7.5CVSS 3.1vec-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.
- Published
- 27 Dec 2021
- Last modified
- 17 Jun 2026
- Assigned by
- cve@mitre.org
- NVD status
- Modified
- Weakness
- CWE-787
- Also known as
- GHSA-jmwx-r3gq-qq3pGHSA-x76r-966h-5qv9RUSTSEC-2021-0082
- Sources
- NVDJSONOSV GHSA-jmwx-r3gq-qq3pJSONOSV GHSA-x76r-966h-5qv9JSONOSV RUSTSEC-2021-0082JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| OSV | GitHub | CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | MEDIUM 5.0 | AV:N/AC:L/Au:N/C:N/I:N/A:P |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | vec-const_project | vec-constcpe:2.3:a:vec-const_project:vec-const:*:*:*:*:*:rust:*:* |
< 2.0.0 | 2.0.0 |
| OSV | crates.io | vec-const | < 2.0.0 | 2.0.0 |
| OSV | crates.io | vec-const | >= 0.0.0-0, < 2.0.0 | 2.0.0 |
References
- https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/vec-const/RUSTSEC-2021-0082.md · Third Party Advisory, WEB
- https://rustsec.org/advisories/RUSTSEC-2021-0082.html · Third Party Advisory, WEB, ADVISORY
- https://github.com/Eolu/vec-const/issues/1#issuecomment-898908241 · WEB, REPORT
- https://github.com/Eolu/vec-const · WEB
- https://nvd.nist.gov/vuln/detail/CVE-2021-45680 · ADVISORY
- https://crates.io/crates/vec-const · PACKAGE
History
- 25 Nov 2026 20:33 UTC · NVD: first stored (published 27 Dec 2021)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 6 Jan 2022)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 14 Aug 2021)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 17 Jun 2022)