CVE-2021-25900
JSON

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 packageVersionsReported by
Unspecified productn/aCVE List
smallvec (crates.io)from 0.6.3 before 0.6.14, from 1.0.0 before 1.6.1GitHub Advisory Database, RustSec Advisory Database
servo smallvecfrom 0.6.3 before 0.6.14, from 1.0.0 before 1.6.1NVD

All scores

GitHub9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
RustSec Advisory Database9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD7.5high CVSS:2.0AV: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

SourceRecordLicence
CVE ListCVE-2021-25900 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-43w2-9j62-hq99 changed 2023-11-08CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2021-0003 changed 2026-07-17CC0-1.0
NVDCVE-2021-25900 changed 2026-06-17Public domain