7.5high
vec-const attempts to construct a Vec from a pointer to a const slice
- Severity
- 7.5high CVSS:3.1 by NVD
- Exploit likelihood
- 1.09% (higher than 66% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- GHSA-jmwx-r3gq-qq3pGHSA-x76r-966h-5qv9RUSTSEC-2021-0082
Description
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| vec-const (crates.io) | before 2.0.0, from 0.0.0-0 before 2.0.0 | GitHub Advisory Database, RustSec Advisory Database |
| vec-const_project vec-const | before 2.0.0 | NVD |
All scores
| GitHub | medium rating | |
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 5.0medium CVSS:2.0 | AV:N/AC:L/Au:N/C:N/I:N/A:P |
Classification
What each source says
CVE List
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.
GitHub Advisory Database
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.
NVD (es)
Se ha detectado un problema en la crate vec-const versiones anteriores a 2.0.0 de Rust. Intenta construir un Vec a partir de un puntero a un slice const, conllevando a una corrupción de memoria
References
| https://rustsec.org/advisories/RUSTSEC-2021-0082.html | advisory, third-party-advisory, web | |
| https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/vec-const/RUSTSEC-2021-0082.md | third-party-advisory, web | |
| https://github.com/Eolu/vec-const/issues/1#issuecomment-898908241 | report, web | |
| https://github.com/Eolu/vec-const | web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-45680 | advisory | |
| https://crates.io/crates/vec-const | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-45680 changed 2024-08-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-jmwx-r3gq-qq3p changed 2023-11-08 | CC-BY-4.0 |
| GitHub Advisory Database | GHSA-x76r-966h-5qv9 changed 2023-11-08 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2021-0082 changed 2025-12-17 | CC0-1.0 |
| NVD | CVE-2021-45680 changed 2026-06-17 | Public domain |