PT-2021-18546 · Crates.Io · Insert Many

Published

2021-01-26

·

Updated

2021-08-25

·

CVE-2021-29933

CVSS v3.1

7.5

High

VectorAV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Name of the Vulnerable Software and Affected Versions insert many crate through 2021-01-26
Description An issue in the insert many crate for Rust may cause elements to be dropped twice if the next() method of an iterator panics. This occurs because affected versions of insert many used ptr::copy to move items in a vector, duplicating their ownership, and then iterated over a provided Iterator to insert new items. If the iterator's next() method panics, the vector would drop the same elements twice.
Recommendations For insert many crate through 2021-01-26, consider updating to a version that does not use ptr::copy to move items in a vector, to prevent elements from being dropped twice in case of a panic. As a temporary workaround, consider handling the panic in the next() method to prevent the double drop of elements.

Exploit

Fix

Double Free

Found an issue in the description? Have something to add? Feel free to write us 👾

Weakness Enumeration

Related Identifiers

CVE-2021-29933
GHSA-29HG-R7C7-54FR
RUSTSEC-2021-0042

Affected Products

Insert Many