IdMap from_iter may lead to uninitialized memory being freed on drop
What to do
Vendor fix available. Upgrade each affected package to the fixed version on its release line (id-map 0.2.2), redeploy, then verify what is actually installed.
This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.
Affected packages
crates.io id-map
- Affected
- >= 0.1.6, < 0.2.2
- Fixed in
- 0.2.2
Sources
- GitHub Advisory Database and maintainer security advisories on GitHub
GitHub-reviewed advisory GHSA-qq4c-hm99-979m lists affected ranges: crates.io id-map >=0.1.6 <0.2.2
VerifiedObserved Structured GitHub Advisory Database record (type=reviewed) from the GitHub REST API.
Severity and exploitation
- Exploitation
- No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
- CVSS 4.0
- 6.9 · 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 · score source
- EPSS
- No dated EPSS signal available.
Source description
As published by the source; long descriptions are shortened.
Due to a flaw in the constructor idmap::IdMap::fromiter, 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: - slab - slotmap
Dates and revisions
- Published by the source
- Last modified by the source
- Source last checked
- Revision 1 · created ·
Published from ghsa record GHSA-qq4c-hm99-979m
Agent brief
Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.
# Patch Next advisory brief: GHSA-qq4c-hm99-979m Advisory: IdMap from_iter may lead to uninitialized memory being freed on drop IDs: GHSA-qq4c-hm99-979m Record: https://patchnext.com/advisories/ghsa-qq4c-hm99-979m (revision 1, source checked 26 Oct 2026, 15:39 UTC) Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected. Severity: Medium (CVSS 6.9) Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV. Vendor response: Vendor fix available; fixed versions by package: id-map 0.2.2. A vendor fix does not mean a deployment is fixed. ## Affected components - crates.io id-map: affected >= 0.1.6, < 0.2.2; fixed in 0.2.2 ## Suggested inspection (read-only) - crates.io id-map: check the installed version with your package manager. ## Supported action Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version. ## Required regression checks - Run the test suite and a production build. - Exercise the features that depend on id-map. - Repeat the inspection and confirm that only fixed versions remain installed. ## Rollback considerations - Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward. ## Unresolved questions - Which deployments run an affected version? - Exploitation status can change. Check again before lowering the priority. - Mark the work resolved only after the fixed version is verified in production. ## Sources - Verified: https://github.com/advisories/GHSA-qq4c-hm99-979m (GitHub-reviewed advisory GHSA-qq4c-hm99-979m lists affected ranges: crates.io id-map >=0.1.6 <0.2.2) Commands are suggestions: review each one before running it.
Loading voting…