GHSA-qq4c-hm99-979m: Id map IdMap From_iter May Lead To Vulnerability
MODERATEGHSA-qq4c-hm99-979m is a MODERATE idmap from_iter may lead to vulnerability (CWE-665: Improper Initialization) affecting Id map libraries in the crates.io ecosystem. The issue involves idmap from_iter may lead to uninitialized memory being freed on drop. Remediation is available by upgrading affected packages to version 0.2.2.
GHSA-qq4c-hm99-979m at a Glance
How to Fix GHSA-qq4c-hm99-979m
To remediate this vulnerability, upgrade all affected Id map dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade id-map to 0.2.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for id-map
How to Check if You Are Affected
To determine whether your application is affected by GHSA-qq4c-hm99-979m, inspect your project dependencies for Id map:
inspect dependencies for id-map
Analyze the terminal output to locate any version of Id map in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.2.2), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-665: Improper Initialization, where the product does not initialize or incorrectly initializes a resource, which might leave the resource in an unexpected state when it is accessed or used. In Id map, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-qq4c-hm99-979m Affected Id map Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
id-map
|
crates.io |
≥ 0.1.6
< 0.2.2
|
0.2.2
|
References
Frequently Asked Questions
What is GHSA-qq4c-hm99-979m?
Which Id map versions are affected?
What version fixes GHSA-qq4c-hm99-979m?
Is id-map affected?
What CWE is associated with GHSA-qq4c-hm99-979m?
How can I check crates.io dependencies for GHSA-qq4c-hm99-979m?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-qq4c-hm99-979m",
"modified" : "2025-08-18T15:10:15Z",
"published" : "2025-08-18T15:10:15Z",
"aliases" : [ ],
"summary" : "IdMap from_iter may lead to uninitialized memory being freed on drop",
"details" : "Due to a flaw in the constructor `id_map::IdMap::from_iter`, ill-formed objects may be created in which the amount of actually initialized memory is less than what is expected by the fields of `IdMap`. Specifically, the field `ids` is initialized based on the capacity of the vector `values`, which is constructed from the provided iterator. However, the length of this vector may be smaller than its capacity.\n\nIn such cases, when the resulting `IdMap` is dropped, its destructor incorrectly assumes that `values` contains `ids.len() == values.capacity()` initialized elements and attempts to iterate over and drop them. This leads to dereferencing and attempting to free uninitialized memory, resulting in undefined behavior and potential segmentation faults.\n\nThe bug was fixed in commit `fab6922`, and all unsafe code was removed from the crate.\n\nNote that the maintainer recommends using the following alternatives:\n- [slab](https://crates.io/crates/slab)\n- [slotmap](https://crates.io/crates/slotmap)",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "id-map"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.1.6"
}, {
"fixed" : "0.2.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/andrewhickman/id-map/issues/4"
}, {
"type" : "WEB",
"url" : "https://github.com/andrewhickman/id-map/commit/fab6922b955b5a2986dfff2ccb341628faec30ed"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/andrewhickman/id-map"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2025-0050.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-665" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-08-18T15:10:15Z",
"nvd_published_at" : null
}
}