Email me

Rust advisories / id-map

Vulnerability CriticalRUSTSEC-2021-0052 · id-map

RUSTSEC-2021-0052: Multiple functions can cause double-frees

Short answerA security vulnerability in the id-map crate: Multiple functions can cause double-frees. GitHub rates it Critical. No fixed version: replace the crate or remove the affected code path.

Crateid-map
TypeVulnerability (memory-corruption)
Affected versionsEvery version.
Fixed innone
SeverityCritical (GitHub rating)
Published2021-02-26
Last changed2024-03-15
Also known asCVE-2021-30455, CVE-2021-30456, CVE-2021-30457, GHSA-8gmx-cpcg-f8h5, GHSA-rccq-j2m7-8fwr, GHSA-vfqx-hv88-f9cv

What to do

  1. Find who pulls it in: cargo tree -i id-map.
  2. Avoid the affected API, or replace the crate.

Details from the advisory

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.

References

From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.

Other advisories for id-map

Full security history of id-map

Up next

Same crateid-map: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ