{"id":"CVE-2021-30455","aliases":["CVE-2021-30455","GHSA-8gmx-cpcg-f8h5","GHSA-rccq-j2m7-8fwr","GHSA-vfqx-hv88-f9cv","RUSTSEC-2021-0052"],"related":["CVE-2021-30456","CVE-2021-30457"],"kind":"vulnerability","state":"published","title":"Double-free in id-map","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"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.\nget_or_insert\n\nget_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.\nremove_set\n\nWhen 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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"The following functions in the crate are affected:\n\n## `IdMap::clone_from`\n\nThe `clone_from` implementation for `IdMap` drops the values present in the\nmap and then begins cloning values from the other map. If a `.clone()` call\npancics, then the afformentioned dropped elements can be freed again.\n\n## `get_or_insert`\n\n`get_or_insert` reserves space for a value, before calling the user provided\ninsertion function `f`. If the function `f` panics then uninitialized or\npreviously freed memory can be dropped.\n\n## `remove_set`\n\nWhen removing a set of elements, `ptr::drop_in_place` is called on each of the\nelement to be removed. If the `Drop` impl of one of these elements panics then\nthe previously dropped elements can be dropped again.","format":"markdown","source":"rustsec"},{"lang":"es","text":"Se detectó un problema en la crate id-map hasta el 26/02/2021 para Rust.&#xa0;Una doble liberación puede ocurrir en IdMap::clone_from sobre un pánico de .clone","source":"nvd"}],"published":"2021-02-26T12:00:00.000Z","modified":"2026-06-17T03:50:16.623Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","score":7.5,"rating":"HIGH"}],"cwes":["CWE-415"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"0.2.1"}],"ecosystem":"crates.io","package":"id-map","purl":"pkg:cargo/id-map","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"0.2.1"}],"ecosystem":"crates.io","package":"id-map","purl":"pkg:cargo/id-map","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"0.2.1"}],"ecosystem":"crates.io","package":"id-map","purl":"pkg:cargo/id-map","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected"}],"ecosystem":"crates.io","package":"id-map","purl":"pkg:cargo/id-map","source":"rustsec"},{"ranges":[{"status":"affected","lastAffected":"2021-02-26"}],"vendor":"id-map_project","product":"id-map","cpe":"cpe:2.3:a:id-map_project:id-map:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0052.html","tags":["advisory","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-30455","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/andrewhickman/id-map/issues/3","tags":["report","web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/andrewhickman/id-map","tags":["package"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-30457","tags":["advisory"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-30456","tags":["advisory"],"sources":["ghsa"]},{"url":"https://crates.io/crates/id-map","tags":["package"],"sources":["rustsec"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-30455","url":"https://www.cve.org/CVERecord?id=CVE-2021-30455","licence":"CVE Terms of Use","modified":"2024-08-03T22:32:41.262Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-8gmx-cpcg-f8h5","url":"https://github.com/advisories/GHSA-8gmx-cpcg-f8h5","licence":"CC-BY-4.0","modified":"2024-03-15T00:05:24.656Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-rccq-j2m7-8fwr","url":"https://github.com/advisories/GHSA-rccq-j2m7-8fwr","licence":"CC-BY-4.0","modified":"2024-03-15T00:05:24.656Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-vfqx-hv88-f9cv","url":"https://github.com/advisories/GHSA-vfqx-hv88-f9cv","licence":"CC-BY-4.0","modified":"2024-03-15T00:05:24.656Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2021-0052","url":"https://rustsec.org/advisories/RUSTSEC-2021-0052.html","licence":"CC0-1.0","modified":"2024-03-15T00:05:24.656Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-30455","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-30455","licence":"Public domain","modified":"2026-06-17T03:50:16.623Z"}],"updatedAt":"2026-11-25T22:58:00.667Z","epss":{"score":0.01139,"percentile":0.67521,"date":"2026-12-01T12:00:22.000Z"}}