Email me

Rust advisories / smallvec

Vulnerability CriticalRUSTSEC-2021-0003 · smallvec

RUSTSEC-2021-0003: Buffer overflow in SmallVec::insert_many

Short answerA security vulnerability in the smallvec crate: Buffer overflow in SmallVec::insert_many. Critical severity (CVSS 9.8). Fixed in 0.6.14, 1.6.1: update to a fixed version.

Cratesmallvec
TypeVulnerability (memory-corruption)
Affected versionsFrom 0.6.3 before 0.6.14; from 1.0.0 before 1.6.1.
Fixed in0.6.14, 1.6.1
SeverityCritical, CVSS 9.8
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Published2021-01-08
Last changed2026-07-17
Also known asCVE-2021-25900, GHSA-43w2-9j62-hq99
Affected functionssmallvec::SmallVec::insert_many

What to do

  1. See which version you have: cargo tree -i smallvec (it also shows which of your dependencies pulls it in).
  2. Update within your version requirement: cargo update -p smallvec. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for example smallvec = "1.6.1") or update the dependency that pulls it in.
  3. Check again with cargo audit, or paste your Cargo.lock into our Cargo.toml checker.

Details from the advisory

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.

References

From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.

Other advisories for smallvec

Full security history of smallvec

Up next

Same cratesmallvec: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ