{"id":"CVE-2021-30455","aliases":["EUVD-2021-1639","GHSA-8gmx-cpcg-f8h5","GHSA-rccq-j2m7-8fwr","GHSA-vfqx-hv88-f9cv","RUSTSEC-2021-0052"],"status":"published","title":"Double-free in id-map","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.","severity":{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"primary","from":"nvd"},"epss":{"day":"2026-11-11","score":0.01139,"percentile":0.67021,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":false},"cwes":["CWE-415"],"published":"2021-02-26T12:00:00Z","modified":"2026-06-17T03:50:16Z","affected":[{"source":"ghsa","ecosystem":"crates.io","package":"id-map","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"0.2.1"}]}]},{"source":"osv","ecosystem":"crates.io","package":"id-map","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"last_affected":"0.2.1"}]}],"bundled":3},{"source":"osv","ecosystem":"crates.io","package":"id-map","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"last_affected":"0.2.1"}]}],"bundled":3},{"source":"osv","ecosystem":"crates.io","package":"id-map","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"last_affected":"0.2.1"}]}],"bundled":3},{"source":"osv","ecosystem":"crates.io","package":"id-map","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"}]}],"bundled":3}],"products":[{"vendor":"id-map_project","product":"id-map"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0052.html","tags":["x_refsource_MISC","x_transferred","Third Party Advisory","web","advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-30455","tags":["advisory"]},{"url":"https://github.com/andrewhickman/id-map/issues/3","tags":["web","report"]},{"url":"https://github.com/advisories/GHSA-8gmx-cpcg-f8h5"},{"url":"https://github.com/andrewhickman/id-map","tags":["package"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-30457","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-30456","tags":["advisory"]},{"url":"https://crates.io/crates/id-map","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2021-30455","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.","status":"published","published":"2021-04-07T21:20:07Z","modified":"2024-08-03T22:32:41.262Z","updated_at":"2026-11-02T14:33:02.20241Z"}],"euvd":[{"id":"EUVD-2021-1639","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.","status":"published","published":"2021-04-07T21:20:07Z","modified":"2024-08-03T22:32:41Z","updated_at":"2026-11-03T03:24:42.48986Z"}],"ghsa":[{"id":"GHSA-8gmx-cpcg-f8h5","title":"Double-free in id-map","description":"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.","status":"published","published":"2021-08-25T20:55:11Z","modified":"2023-06-22T05:03:19Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-415"],"updated_at":"2026-11-02T14:36:55.184601Z"}],"nvd":[{"id":"CVE-2021-30455","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.","status":"published","published":"2021-04-07T22:15:15.177Z","modified":"2026-06-17T03:50:16.623Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"primary"},{"version":"2.0","score":7.5,"vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","level":"high","assessor":"primary"}],"cwes":["CWE-415"],"updated_at":"2026-11-02T14:06:51.610648Z"}],"osv":[{"id":"GHSA-8gmx-cpcg-f8h5","title":"Double-free in id-map","description":"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.","status":"published","published":"2021-08-25T20:55:11Z","modified":"2024-03-15T00:05:24.656544Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-415"],"updated_at":"2026-11-02T15:46:42.437513Z"},{"id":"GHSA-rccq-j2m7-8fwr","title":"Double-free in id-map","description":"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.","status":"published","published":"2021-08-25T20:55:14Z","modified":"2024-03-15T00:05:24.656544Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-415"],"updated_at":"2026-11-02T15:46:55.877614Z"},{"id":"GHSA-vfqx-hv88-f9cv","title":"Double-free in id-map","description":"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.","status":"published","published":"2021-08-25T20:55:22Z","modified":"2024-03-15T00:05:24.656544Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-415"],"updated_at":"2026-11-02T15:46:57.348035Z"},{"id":"RUSTSEC-2021-0052","title":"Multiple functions can cause double-frees","description":"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.","status":"published","published":"2021-02-26T12:00:00Z","modified":"2024-03-15T00:05:24.656544Z","updated_at":"2026-11-02T15:53:39.492624Z"}]}}
