CVE-2021-25900: Buffer Overflow

Published Jan 22, 2021
·
Updated

A bug in the SmallVec::insertmany 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 insertmany yielded more items than the lower bound returned from its sizehint 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 insertmany to use less unsafe code, so it is easier to verify its correctness.

Other sources

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::insertmany.

Affected Software

4 affected componentsFixes available
rust/smallvec>=1.0.0<1.6.1
1.6.1
rust/smallvec>=0.6.3<0.6.14
0.6.14
Servo Smallvec Rust>=0.6.3<0.6.14
Servo Smallvec Rust>=1.0.0<1.6.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade rust/smallvec to a version that resolves this vulnerability.

    Fixed in 1.6.1
  2. Upgrade

    Upgrade rust/smallvec to a version that resolves this vulnerability.

    Fixed in 0.6.14
  3. Upgrade

    Upgrade smallvec to a version that resolves this vulnerability.

    Fixed in 0.6.14
  4. Upgrade

    Upgrade smallvec to a version that resolves this vulnerability.

    Fixed in 1.6.1

Event History

Jan 22, 2021
CVE Published
via MITRE·09:03 AM
Data Sourced
via MITRE·09:03 AM
Description
Jan 26, 2021
Data Sourced
via OSV·06:16 PM
DescriptionSeverity
May 24, 2022
Advisory Published
05:40 PM

Frequently Asked Questions

1

What is CVE-2021-25900?

CVE-2021-25900 is a vulnerability in the SmallVec::insert_many method that causes a buffer overflow and memory corruption on the heap.

2

What is the severity of CVE-2021-25900?

The severity of CVE-2021-25900 is critical, with a CVSS score of 9.8.

3

How does CVE-2021-25900 impact the SmallVec package?

CVE-2021-25900 impacts the SmallVec package by allowing an attacker to trigger a buffer overflow and memory corruption.

4

How can I fix CVE-2021-25900?

To fix CVE-2021-25900, you should update the SmallVec package to version 1.6.1 or version 0.6.14, depending on your usage.

5

Where can I find more information about CVE-2021-25900?

You can find more information about CVE-2021-25900 on the NIST National Vulnerability Database (NVD), RustSec advisories, and the GitHub issue page for the SmallVec package.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203