CVE-2021-25900: Buffer Overflow
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
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
rust/smallvecto a version that resolves this vulnerability.Fixed in 1.6.1 - Upgrade
Upgrade
rust/smallvecto a version that resolves this vulnerability.Fixed in 0.6.14 - Upgrade
Upgrade
smallvecto a version that resolves this vulnerability.Fixed in 0.6.14 - Upgrade
Upgrade
smallvecto a version that resolves this vulnerability.Fixed in 1.6.1
Event History
Frequently Asked Questions
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.
What is the severity of CVE-2021-25900?
The severity of CVE-2021-25900 is critical, with a CVSS score of 9.8.
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.
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.
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.