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 package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| id-map (crates.io) | up to 0.2.1, from 0.0.0-0 | GitHub Advisory Database, RustSec Advisory Database |
| id-map_project id-map | up to 2021-02-26 | NVD |
All scores
| GitHub | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 7.5high CVSS:2.0 | AV: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
| https://rustsec.org/advisories/RUSTSEC-2021-0052.html | advisory, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-30455 | advisory | |
| https://github.com/andrewhickman/id-map/issues/3 | report, web | |
| https://github.com/andrewhickman/id-map | package | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-30457 | advisory | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-30456 | advisory | |
| https://crates.io/crates/id-map | package | |
Related
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-30455 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-8gmx-cpcg-f8h5 changed 2024-03-15 | CC-BY-4.0 |
| GitHub Advisory Database | GHSA-rccq-j2m7-8fwr changed 2024-03-15 | CC-BY-4.0 |
| GitHub Advisory Database | GHSA-vfqx-hv88-f9cv changed 2024-03-15 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2021-0052 changed 2024-03-15 | CC0-1.0 |
| NVD | CVE-2021-30455 changed 2026-06-17 | Public domain |