CVE-2021-30455
JSON

9.8critical

Double-free in id-map

Severity
9.8critical CVSS:3.1 by NVD
Exploit likelihood
1.14% (higher than 67% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
mitre
Also known as
GHSA-8gmx-cpcg-f8h5GHSA-rccq-j2m7-8fwrGHSA-vfqx-hv88-f9cvRUSTSEC-2021-0052

Description

An issue was discovered in the id-map crate through 2021-02-26 for Rust. A double free can occur in IdMap::clone_from upon a .clone panic.

Affected

Product or packageVersionsReported by
Unspecified productn/aCVE List
id-map (crates.io)up to 0.2.1, from 0.0.0-0GitHub Advisory Database, RustSec Advisory Database
id-map_project id-mapup to 2021-02-26NVD

All scores

GitHub9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD7.5high CVSS:2.0AV:N/AC:L/Au:N/C:P/I:P/A:P

Classification

What each source says

CVE List

An issue was discovered in the id-map crate through 2021-02-26 for Rust. A double free can occur in IdMap::clone_from upon a .clone panic.

GitHub Advisory Database

The clone_from implementation for IdMap drops the values present in the map and then begins cloning values from the other map. If a .clone() call pancics, then the afformentioned dropped elements can be freed again. get_or_insert

get_or_insert reserves space for a value, before calling the user provided insertion function f. If the function f panics then uninitialized or previously freed memory can be dropped. remove_set

When removing a set of elements, ptr::drop_in_place is called on each of the element to be removed. If the Drop impl of one of these elements panics then the previously dropped elements can be dropped again.

GitHub Advisory Database

A double free can occur in remove_set upon a panic in a Drop impl. When removing a set of elements, ptr::drop_in_place is called on each of the element to be removed. If the Drop impl of one of these elements panics then the previously dropped elements can be dropped again.

GitHub Advisory Database

A double free can occur in get_or_insert upon a panic of a user-provided f function. get_or_insert reserves space for a value, before calling the user provided insertion function f. If the function f panics then uninitialized or previously freed memory can be dropped.

RustSec Advisory Database

The following functions in the crate are affected:

IdMap::clone_from

The clone_from implementation for IdMap drops the values present in the map and then begins cloning values from the other map. If a .clone() call pancics, then the afformentioned dropped elements can be freed again.

get_or_insert

get_or_insert reserves space for a value, before calling the user provided insertion function f. If the function f panics then uninitialized or previously freed memory can be dropped.

remove_set

When removing a set of elements, ptr::drop_in_place is called on each of the element to be removed. If the Drop impl of one of these elements panics then the previously dropped elements can be dropped again.

NVD (es)

Se detectó un problema en la crate id-map hasta el 26/02/2021 para Rust. Una doble liberación puede ocurrir en IdMap::clone_from sobre un pánico de .clone

References

Related

Sources

SourceRecordLicence
CVE ListCVE-2021-30455 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-8gmx-cpcg-f8h5 changed 2024-03-15CC-BY-4.0
GitHub Advisory DatabaseGHSA-rccq-j2m7-8fwr changed 2024-03-15CC-BY-4.0
GitHub Advisory DatabaseGHSA-vfqx-hv88-f9cv changed 2024-03-15CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2021-0052 changed 2024-03-15CC0-1.0
NVDCVE-2021-30455 changed 2026-06-17Public domain