{"id":"CVE-2021-29939","aliases":["CVE-2021-29939","GHSA-9frf-r7c7-j2vg","RUSTSEC-2021-0048"],"related":[],"kind":"vulnerability","state":"published","title":"Out of bounds write in stackvector","summary":"An issue was discovered in the stackvector crate through 2021-02-19 for Rust. There is an out-of-bounds write in StackVec::extend if size_hint provides certain anomalous data.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"An issue was discovered in the stackvector crate through 2021-02-19 for Rust. There is an out-of-bounds write in StackVec::extend if size_hint provides certain anomalous data.","source":"cvelist"},{"lang":"en","text":"StackVec::extend used the lower and upper bounds from an Iterator's size_hint to determine how many items to push into the stack based vector. If the size_hint implementation returned a lower bound that was larger than the upper bound, StackVec would write out of bounds and overwrite memory on the stack. As mentioned by the size_hint documentation, size_hint is mainly for optimization and incorrect implementations should not lead to memory safety issues.","format":"markdown","source":"ghsa"},{"lang":"en","text":"`StackVec::extend` used the lower and upper bounds from an Iterator's\n`size_hint` to determine how many items to push into the stack based vector.\n\nIf the `size_hint` implementation returned a lower bound that was larger than\nthe upper bound, `StackVec` would write out of bounds and overwrite memory\non the stack. As mentioned by the [size_hint](https://doc.rust-lang.org/std/iter/trait.Iterator.html#provided-methods)\ndocumentation, `size_hint` is mainly for optimization and incorrect\nimplementations should not lead to memory safety issues.","format":"markdown","source":"rustsec"},{"lang":"es","text":"Se detectó un problema en la crate stackvector hasta el 19-02-2021 para Rust.&#xa0;Se presenta una escritura fuera de límites en la función StackVec::extend si size_hint proporciona determinados datos anómalos.","source":"nvd"}],"published":"2021-02-19T12:00:00.000Z","modified":"2026-06-17T03:48:28.670Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","score":7.3,"rating":"HIGH"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","score":7.3,"rating":"HIGH"},{"scorer":"RustSec Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","score":7.3,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","score":7.3,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","score":7.5,"rating":"HIGH"}],"cwes":["CWE-787"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.0.9"}],"ecosystem":"crates.io","package":"stackvector","purl":"pkg:cargo/stackvector","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"1.0.9"}],"ecosystem":"crates.io","package":"stackvector","purl":"pkg:cargo/stackvector","source":"rustsec"},{"ranges":[{"status":"affected","fixed":"1.0.9"}],"vendor":"stackvector_project","product":"stackvector","cpe":"cpe:2.3:a:stackvector_project:stackvector:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0048.html","tags":["advisory","exploit","vendor-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-29939","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/Alexhuszagh/rust-stackvector/issues/2","tags":["report","web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/Alexhuszagh/rust-stackvector","tags":["package"],"sources":["ghsa"]},{"url":"https://crates.io/crates/stackvector","tags":["package"],"sources":["rustsec"]}],"credits":[],"assigner":"mitre","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2024-11-19T16:11:10.891Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-29939","url":"https://www.cve.org/CVERecord?id=CVE-2021-29939","licence":"CVE Terms of Use","modified":"2024-11-19T16:11:27.677Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-9frf-r7c7-j2vg","url":"https://github.com/advisories/GHSA-9frf-r7c7-j2vg","licence":"CC-BY-4.0","modified":"2023-11-08T04:05:44.063Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2021-0048","url":"https://rustsec.org/advisories/RUSTSEC-2021-0048.html","licence":"CC0-1.0","modified":"2023-11-08T04:05:44.063Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-29939","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-29939","licence":"Public domain","modified":"2026-06-17T03:48:28.670Z"}],"updatedAt":"2026-11-25T22:58:00.540Z","epss":{"score":0.01025,"percentile":0.64536,"date":"2026-12-01T12:00:22.000Z"}}