9.8critical
Buffer overflow in SmallVec::insert_many
- Severity
- 9.8critical CVSS:3.1 by NVD
- Exploit likelihood
- 1.72% (higher than 78% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- GHSA-43w2-9j62-hq99RUSTSEC-2021-0003
Description
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| smallvec (crates.io) | from 0.6.3 before 0.6.14, from 1.0.0 before 1.6.1 | GitHub Advisory Database, RustSec Advisory Database |
| servo smallvec | from 0.6.3 before 0.6.14, from 1.0.0 before 1.6.1 | NVD |
All scores
| GitHub | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| RustSec Advisory Database | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 7.5high CVSS:2.0 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
Classification
What each source says
CVE List
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.
GitHub Advisory Database
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.
The 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.
RustSec Advisory Database
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.
The 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.
Thank you to Yechan Bae (@Qwaz) and the Rust group at Georgia Tech’s SSLab for finding and reporting this bug.
NVD (es)
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. Se presenta un desbordamiento del búfer en la región heap de la memoria en la función SmallVec::insert_many
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-25900 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-43w2-9j62-hq99 changed 2023-11-08 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2021-0003 changed 2026-07-17 | CC0-1.0 |
| NVD | CVE-2021-25900 changed 2026-06-17 | Public domain |