{"id":"CVE-2021-25900","aliases":["CVE-2021-25900","GHSA-43w2-9j62-hq99","RUSTSEC-2021-0003"],"related":[],"kind":"vulnerability","state":"published","title":"Buffer overflow in SmallVec::insert_many","summary":"An issue was discovered in the smallvec crate before 0.6.14 and 1.x before 1.6.1 for Rust. There is a heap-based buffer overflow in SmallVec::insert_many.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"An issue was discovered in the smallvec crate before 0.6.14 and 1.x before 1.6.1 for Rust. There is a heap-based buffer overflow in SmallVec::insert_many.","source":"cvelist"},{"lang":"en","text":"A bug in the SmallVec::insert_many method caused it to allocate a buffer that was smaller than needed. It then wrote past the end of the buffer, causing a buffer overflow and memory corruption on the heap. This bug was only triggered if the iterator passed to insert_many yielded more items than the lower bound returned from its size_hint method.\n\nThe flaw was corrected in smallvec 0.6.14 and 1.6.1, by ensuring that additional space is always reserved for each item inserted. The fix also simplified the implementation of insert_many to use less unsafe code, so it is easier to verify its correctness.","format":"markdown","source":"ghsa"},{"lang":"en","text":"A bug in the `SmallVec::insert_many` method caused it to allocate a buffer that was smaller than needed.  It then wrote past the end of the buffer, causing a buffer overflow and memory corruption on the heap.\n\nThis bug was only triggered if the iterator passed to `insert_many` yielded more items than the lower bound returned from its `size_hint` method.\n \nThe flaw was corrected in smallvec 0.6.14 and 1.6.1, by ensuring that additional space is always reserved for each item inserted.  The fix also simplified the implementation of `insert_many` to use less unsafe code, so it is easier to verify its correctness.\n\nThank you to Yechan Bae ([@Qwaz](https://github.com/Qwaz)) and the Rust group at Georgia Tech’s SSLab for finding and reporting this bug.","format":"markdown","source":"rustsec"},{"lang":"es","text":"Se detectó un problema en la crate smallvec versiones anteriores a 0.6.14 y versiones 1.x anteriores a 1.6.1 para Rust.&#xa0;Se presenta un desbordamiento del búfer en la región heap de la memoria en la función SmallVec::insert_many","source":"nvd"}],"published":"2021-01-08T12:00:00.000Z","modified":"2026-07-17T16:00:03.208Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"RustSec Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"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.6.3","status":"affected","fixed":"0.6.14"}],"ecosystem":"crates.io","package":"smallvec","purl":"pkg:cargo/smallvec","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"1.0.0","status":"affected","fixed":"1.6.1"}],"ecosystem":"crates.io","package":"smallvec","purl":"pkg:cargo/smallvec","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.6.3","status":"affected","fixed":"0.6.14"},{"type":"semver","introduced":"1.0.0","status":"affected","fixed":"1.6.1"}],"ecosystem":"crates.io","package":"smallvec","purl":"pkg:cargo/smallvec","source":"rustsec"},{"ranges":[{"status":"affected","introduced":"0.6.3","fixed":"0.6.14"},{"status":"affected","introduced":"1.0.0","fixed":"1.6.1"}],"vendor":"servo","product":"smallvec","cpe":"cpe:2.3:a:servo:smallvec:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0003.html","tags":["advisory","exploit","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-25900","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/servo/rust-smallvec/issues/252","tags":["report","web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/servo/rust-smallvec/commit/5757ac500d4e544485d796b542e4e589749c291b","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/servo/rust-smallvec/commit/9998ba0694a6b51aa6604748b00b6a98f0a0039e","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/servo/rust-smallvec","tags":["package"],"sources":["ghsa"]},{"url":"https://crates.io/crates/smallvec","tags":["package"],"sources":["rustsec"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-25900","url":"https://www.cve.org/CVERecord?id=CVE-2021-25900","licence":"CVE Terms of Use","modified":"2024-08-03T20:11:28.459Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-43w2-9j62-hq99","url":"https://github.com/advisories/GHSA-43w2-9j62-hq99","licence":"CC-BY-4.0","modified":"2023-11-08T04:05:16.493Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2021-0003","url":"https://rustsec.org/advisories/RUSTSEC-2021-0003.html","licence":"CC0-1.0","modified":"2026-07-17T16:00:03.208Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-25900","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-25900","licence":"Public domain","modified":"2026-06-17T03:42:32.730Z"}],"updatedAt":"2026-11-25T22:57:59.723Z","epss":{"score":0.0172,"percentile":0.78158,"date":"2026-12-01T12:00:22.000Z"}}