
Cloud Vulnerability DB
A community-led vulnerabilities database
An issue was discovered in the insert_many crate through 2021-01-26 for Rust, identified as RUSTSEC-2021-0042 (CVE-2021-29933). The vulnerability involves a potential double-free condition where elements may be dropped twice if a .next() method panics during element insertion operations (Rust Advisory).
The vulnerability stems from an implementation flaw in the insert_many crate where the impl_veclike macro performs unsafe operations during element insertion. The issue occurs when ptr::copy is used to push elements for insertion, which can duplicate items in the Vec before calling iter.next(). If iter.next() panics during this operation, the copied elements can be dropped twice, leading to a double-free condition. The vulnerability has been assigned a CVSS v3.1 base score of 7.5 (HIGH) with a vector of CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H (NVD Database).
The vulnerability can result in memory corruption due to double-free operations, which could potentially lead to program crashes or undefined behavior. This is particularly concerning in memory-safe Rust programs where such issues should be prevented by the compiler (GitHub Issue).
The vulnerability can be triggered when using the insert_many operation with an iterator that panics during execution. A proof-of-concept exploit has been demonstrated using a custom iterator implementation that intentionally panics during the next() operation (GitHub Issue).
The recommended mitigation is to wrap the vector in ManuallyDrop while performing these operations to prevent the double-free condition. Users should update to a version newer than 2021-01-26 or implement the suggested workaround (GitHub Issue).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."