{"id":"CVE-2021-45680","aliases":["CVE-2021-45680","GHSA-jmwx-r3gq-qq3p","GHSA-x76r-966h-5qv9","RUSTSEC-2021-0082"],"related":[],"kind":"vulnerability","state":"published","title":"vec-const attempts to construct a Vec from a pointer to a const slice","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"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.\n\nThe implementation was later changed to just construct a `std::borrow::Cow`.","format":"markdown","source":"ghsa"},{"lang":"es","text":"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","source":"nvd"}],"published":"2021-08-14T12:00:00.000Z","modified":"2026-06-17T04:13:56.137Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:N/I:N/A:P","score":5,"rating":"MEDIUM"}],"cwes":["CWE-787"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.0.0"}],"ecosystem":"crates.io","package":"vec-const","purl":"pkg:cargo/vec-const","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.0.0"}],"ecosystem":"crates.io","package":"vec-const","purl":"pkg:cargo/vec-const","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"2.0.0"}],"ecosystem":"crates.io","package":"vec-const","purl":"pkg:cargo/vec-const","source":"rustsec"},{"ranges":[{"status":"affected","fixed":"2.0.0"}],"vendor":"vec-const_project","product":"vec-const","cpe":"cpe:2.3:a:vec-const_project:vec-const:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0082.html","tags":["advisory","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/vec-const/RUSTSEC-2021-0082.md","tags":["third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/Eolu/vec-const/issues/1#issuecomment-898908241","tags":["report","web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/Eolu/vec-const","tags":["web"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-45680","tags":["advisory"],"sources":["ghsa"]},{"url":"https://crates.io/crates/vec-const","tags":["package"],"sources":["rustsec"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-45680","url":"https://www.cve.org/CVERecord?id=CVE-2021-45680","licence":"CVE Terms of Use","modified":"2024-08-04T04:47:01.794Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-jmwx-r3gq-qq3p","url":"https://github.com/advisories/GHSA-jmwx-r3gq-qq3p","licence":"CC-BY-4.0","modified":"2023-11-08T04:07:21.429Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-x76r-966h-5qv9","url":"https://github.com/advisories/GHSA-x76r-966h-5qv9","licence":"CC-BY-4.0","modified":"2023-11-08T04:07:21.429Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2021-0082","url":"https://rustsec.org/advisories/RUSTSEC-2021-0082.html","licence":"CC0-1.0","modified":"2025-12-17T17:18:32.343Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-45680","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-45680","licence":"Public domain","modified":"2026-06-17T04:13:56.137Z"}],"updatedAt":"2026-11-25T22:58:06.259Z","epss":{"score":0.01088,"percentile":0.66295,"date":"2026-12-01T12:00:22.000Z"}}