{"id":"CVE-2021-29939","aliases":["DEBIAN-CVE-2021-29939","EUVD-2021-1659","GHSA-9frf-r7c7-j2vg","RUSTSEC-2021-0048","UBUNTU-CVE-2021-29939"],"status":"published","title":"Out of bounds write in stackvector","description":"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.","severity":{"version":"3.1","score":7.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","level":"high","assessor":"primary","from":"nvd"},"epss":{"day":"2026-11-11","score":0.01025,"percentile":0.64008,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-787"],"published":"2021-02-19T12:00:00Z","modified":"2026-10-23T18:03:13Z","fixes":[{"ecosystem":"crates.io","package":"stackvector","fixed_in":["1.0.9"],"sources":["ghsa","osv"]},{"ecosystem":"Debian:12","package":"rust-stackvector","fixed_in":["1.0.6-3"],"sources":["osv"]},{"ecosystem":"Debian:13","package":"rust-stackvector","fixed_in":["1.0.6-3"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"rust-stackvector","fixed_in":["1.0.6-3"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"crates.io","package":"stackvector","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.9"}]}]},{"source":"osv","ecosystem":"Debian:12","package":"rust-stackvector","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.6-3"}]}]},{"source":"osv","ecosystem":"Debian:13","package":"rust-stackvector","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.6-3"}]}]},{"source":"osv","ecosystem":"Debian:14","package":"rust-stackvector","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.6-3"}]}]},{"source":"osv","ecosystem":"crates.io","package":"stackvector","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.0.9"}]}]},{"source":"osv","ecosystem":"crates.io","package":"stackvector","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"1.0.9"}]}]},{"source":"osv","ecosystem":"Ubuntu:20.04:LTS","package":"rust-stackvector","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.0.6-2"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"rust-stackvector","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.0.6-3","1.1.1-1"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"rust-stackvector","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.1.1-1"]},{"source":"osv","ecosystem":"Ubuntu:25.10","package":"rust-stackvector","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.1.1-1"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"rust-stackvector","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.1.1-1build1"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"rust-stackvector","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.1.1-1","1.1.1-1build1"]}],"products":[{"vendor":"stackvector_project","product":"stackvector"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0048.html","tags":["x_refsource_MISC","x_transferred","Exploit","Vendor Advisory","evidence","web","advisory","report"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-29939","tags":["advisory"]},{"url":"https://github.com/Alexhuszagh/rust-stackvector/issues/2","tags":["web","report"]},{"url":"https://github.com/advisories/GHSA-9frf-r7c7-j2vg"},{"url":"https://security-tracker.debian.org/tracker/CVE-2021-29939","tags":["advisory"]},{"url":"https://github.com/Alexhuszagh/rust-stackvector","tags":["package"]},{"url":"https://crates.io/crates/stackvector","tags":["package"]},{"url":"https://ubuntu.com/security/CVE-2021-29939","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2021-29939","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2021-29939","description":"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.","status":"published","published":"2021-04-01T04:23:03Z","modified":"2024-11-19T16:11:27.677Z","updated_at":"2026-11-02T14:33:06.32268Z"}],"euvd":[{"id":"EUVD-2021-1659","description":"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.","status":"published","published":"2021-04-01T04:23:03Z","modified":"2024-11-19T16:11:27Z","updated_at":"2026-11-03T00:04:56.132572Z"}],"ghsa":[{"id":"GHSA-9frf-r7c7-j2vg","title":"Out of bounds write in stackvector","description":"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.","status":"published","published":"2021-08-25T20:54:14Z","modified":"2023-06-13T20:54:16Z","cvss":[{"version":"3.1","score":7.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","level":"high"}],"cwes":["CWE-787"],"updated_at":"2026-11-02T14:36:54.225318Z"}],"nvd":[{"id":"CVE-2021-29939","description":"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.","status":"published","published":"2021-04-01T05:15:14.843Z","modified":"2026-06-17T03:48:28.67Z","cvss":[{"version":"3.1","score":7.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","level":"high","assessor":"primary"},{"version":"2.0","score":7.5,"vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","level":"high","assessor":"primary"}],"cwes":["CWE-787"],"updated_at":"2026-11-02T14:06:51.197859Z"}],"osv":[{"id":"CVE-2021-29939","description":"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.","status":"published","published":"2021-04-01T05:15:14.843Z","modified":"2026-03-14T10:57:19.198142Z","cvss":[{"version":"3.1","score":7.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","level":"high"}],"updated_at":"2026-11-02T15:44:19.483607Z"},{"id":"DEBIAN-CVE-2021-29939","description":"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.","status":"published","published":"2021-04-01T05:15:14.843Z","modified":"2026-10-23T18:03:13.013519479Z","cvss":[{"version":"3.1","score":7.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","level":"high"}],"updated_at":"2026-11-02T15:45:34.94143Z"},{"id":"GHSA-9frf-r7c7-j2vg","title":"Out of bounds write in stackvector","description":"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.","status":"published","published":"2021-08-25T20:54:14Z","modified":"2023-11-08T04:05:44.06392Z","cvss":[{"version":"3.1","score":7.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","level":"high"}],"cwes":["CWE-787"],"updated_at":"2026-11-02T15:46:43.524801Z"},{"id":"RUSTSEC-2021-0048","title":"StackVec::extend can write out of bounds when size_hint is incorrect","description":"`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.","status":"published","published":"2021-02-19T12:00:00Z","modified":"2023-11-08T04:05:44.06392Z","cvss":[{"version":"3.1","score":7.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","level":"high"}],"updated_at":"2026-11-02T15:53:39.492624Z"},{"id":"UBUNTU-CVE-2021-29939","description":"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.","status":"published","published":"2021-04-01T05:15:00Z","modified":"2026-10-17T12:55:45.690810899Z","cvss":[{"version":"3.1","score":7.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","level":"high"}],"updated_at":"2026-11-02T15:54:26.779273Z"}]}}
