Summary
IdMap from_iter may lead to uninitialized memory being freed on drop
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.
In 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.
The bug was fixed in commit fab6922, and all unsafe code was removed from the crate.
Note that the maintainer recommends using the following alternatives:
Impact
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is GHSA-QQ4C-HM99-979M? GHSA-QQ4C-HM99-979M is a medium-severity security vulnerability in id-map (rust), affecting versions >= 0.1.6, < 0.2.2. It is fixed in 0.2.2.
- Which versions of id-map are affected by GHSA-QQ4C-HM99-979M? id-map (rust) versions >= 0.1.6, < 0.2.2 is affected.
- Is there a fix for GHSA-QQ4C-HM99-979M? Yes. GHSA-QQ4C-HM99-979M is fixed in 0.2.2. Upgrade to this version or later.
- Is GHSA-QQ4C-HM99-979M exploitable, and should I be worried? Whether GHSA-QQ4C-HM99-979M is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether GHSA-QQ4C-HM99-979M is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix GHSA-QQ4C-HM99-979M? Upgrade
id-mapto 0.2.2 or later.