VYPR
Critical severityNVD Advisory· Published Apr 7, 2021· Updated Aug 3, 2024

CVE-2021-30457

CVE-2021-30457

Description

An issue was discovered in the id-map crate through 2021-02-26 for Rust. A double free can occur in remove_set upon a panic in a Drop impl.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

A double-free vulnerability in Rust's id-map crate could be triggered via panic in a Drop impl, leading to memory corruption.

Vulnerability

The remove_set function in the id-map crate (through 2021-02-26) is affected by a double-free vulnerability when a panic occurs inside a Drop implementation of a stored value [1][3]. The issue arises from incorrect handling during panic unwinding, causing previously dropped values to be freed again. This affects all versions of the crate up to the reported date.

Exploitation

An attacker must be able to insert a value whose Drop implementation panics and later call remove_set on that map. This requires the ability to provide a custom type with a panicking Drop impl, which is feasible in environments where user-controlled code can be executed (e.g., libraries processing untrusted data). The panic during the remove_set operation triggers a double free [1].

Impact

A double free can lead to memory corruption, potentially enabling arbitrary code execution, data corruption, or a denial-of-service condition. The exact impact depends on how the memory allocator handles the freed memory and the overall program state [3].

Mitigation

No patched version of the id-map crate has been released [3]. The recommended mitigation is to avoid using the crate with types that may panic in their Drop implementation, or to use alternative crates that provide safer memory handling.

AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
id-mapcrates.io
<= 0.2.1

Affected products

2

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

4

News mentions

0

No linked articles in our index yet.