Vulnerability DatabaseRUSTSEC-2021-0003

RUSTSEC-2021-0003
Rust vulnerability analysis and mitigation

Overview

A heap-based buffer overflow vulnerability was discovered in the smallvec crate versions before 0.6.14 and 1.x before 1.6.1 for Rust. The vulnerability, tracked as RUSTSEC-2021-0003 (CVE-2021-25900), was identified on January 8, 2021, affecting the SmallVec::insert_many functionality (NVD, CVE Mitre).

Technical details

The vulnerability occurs in the insert_many() function when an iterator yields more items than the lower bound of size_hint(). The issue stems from the buffer's length being set to 0 during the operation, causing the reserve(n) function to incorrectly handle capacity allocation. This leads to a potential buffer overflow condition as the subsequent code can write beyond the allocated buffer space (GitHub Issue).

Impact

When exploited, this vulnerability can lead to heap buffer overflow conditions, potentially causing memory corruption, program crashes, or in some cases, arbitrary code execution. The issue can result in undefined behavior even when using safe APIs of smallvec, potentially corrupting heap-allocated data structures (GitHub Issue).

Exploitability

The vulnerability can be triggered through safe Rust code, making it particularly concerning. A proof-of-concept exists demonstrating how the vulnerability can be exploited to cause memory corruption and program crashes using only safe APIs (GitHub Issue).

Mitigation and workarounds

The vulnerability has been fixed in smallvec versions 0.6.14 and 1.6.1. Users are advised to upgrade to these or later versions to mitigate the risk (NVD).

Additional resources


SourceThis report was generated using AI

Related Rust vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-m3wp-48jr-vr4gHIGH7.5
  • Rust logoRust
  • mistralrs-server-core
NoYesSep 10, 2026
GHSA-wfgq-w7cq-qj7jHIGH7.2
  • Rust logoRust
  • mistralrs-server-core
NoYesSep 10, 2026
CVE-2026-45056MEDIUM6.9
  • Rust logoRust
  • matrix-sdk-crypto
NoYesSep 11, 2026
CVE-2026-45057MEDIUM4.9
  • Rust logoRust
  • matrix-sdk-ui
NoYesSep 11, 2026
RUSTSEC-2026-0283NONEN/A
  • Rust logoRust
  • clear_on_drop
NoNoSep 13, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management