CVE-2021-29933:
Double free in insert_many
7.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.59217%
CWE
Published
8/25/2021
Updated
1/9/2023
KEV Status
No
Technology
Rust
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
insert_many | rust | <= 0.1.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability manifests in the macro-generated insert_many
implementation shown in lib.rs
. The unsafe block: 1) Copies elements with ptr::copy
(creating duplicate ownership), 2) Iterates with panic-prone next()
, 3) Only updates length after successful iteration. A panic between steps 1-3 leaves the vector with original length but copied elements, causing double-free during unwinding. The GitHub issue provides a concrete code example demonstrating this sequence, and the CWE-415 classification confirms the double-free nature.