Rust advisories / insert_many
Vulnerability HighRUSTSEC-2021-0042 · insert_many
RUSTSEC-2021-0042: insert_many can drop elements twice on panic
Short answerA security vulnerability in the insert_many crate: insert_many can drop elements twice on panic. High severity (CVSS 7.5). No fixed version: replace the crate or remove the affected code path.
| Crate | insert_many |
|---|---|
| Type | Vulnerability (memory-corruption) |
| Affected versions | Every version. |
| Fixed in | none |
| Severity | High, CVSS 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| Published | 2021-01-26 |
| Last changed | 2023-11-08 |
| Also known as | CVE-2021-29933, GHSA-29hg-r7c7-54fr |
What to do
- Find who pulls it in:
cargo tree -i insert_many. - Avoid the affected API, or replace the crate.
Details from the advisory
Affected versions of insert_many used ptr::copy to move over items in a vector to make space before inserting, duplicating their ownership. It then iterated over a provided Iterator to insert the new items.
If the iterator's .next() method panics then the vector would drop the same elements twice.
References
- Package: crates.io/crates/insert_many
- Advisory: rustsec.org/advisories/RUSTSEC-2021-0042.html
- Report: github.com/rphmeier/insert_many/issues/1
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Up next
Are you affected?Check your whole dependency treePaste Cargo.lock: every advisory, for your exact versions.Read it next →Also worth your time
Did this answer your question?