CVE-2021-45680
JSON

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 packageVersionsReported by
Unspecified productn/aCVE List
vec-const (crates.io)before 2.0.0, from 0.0.0-0 before 2.0.0GitHub Advisory Database, RustSec Advisory Database
vec-const_project vec-constbefore 2.0.0NVD

All scores

GitHubmedium rating
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD5.0medium CVSS:2.0AV: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

Sources

SourceRecordLicence
CVE ListCVE-2021-45680 changed 2024-08-04CVE Terms of Use
GitHub Advisory DatabaseGHSA-jmwx-r3gq-qq3p changed 2023-11-08CC-BY-4.0
GitHub Advisory DatabaseGHSA-x76r-966h-5qv9 changed 2023-11-08CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2021-0082 changed 2025-12-17CC0-1.0
NVDCVE-2021-45680 changed 2026-06-17Public domain