{"answers":{"affected":"3 open source packages ship an affected version, including id-map.","exploited":"There is no known exploitation of GHSA-qq4c-hm99-979m in the wild and no public exploit code.","fix":"Upgrade id-map to 0.2.2 or later.","what":"GHSA-qq4c-hm99-979m is a memory corruption vulnerability in id-map, published on 14 Aug 2025."},"fix_prompt":"Check this codebase for GHSA-qq4c-hm99-979m and fix it if it is affected.\n\nWhat it is: GHSA-qq4c-hm99-979m is a memory corruption vulnerability in id-map, published on 14 Aug 2025. \nExploitation: There is no known exploitation of GHSA-qq4c-hm99-979m in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- id-map (crates.io): affected from 0.1.6; fixed in 0.2.2\n- id-map (crates.io): affected from 0.1.6; fixed in 0.2.2\n- id-map (crates.io): affected from 0.1.6; fixed in 0.2.2\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-qq4c-hm99-979m/ (Markdown: https://insights.sbomify.com/GHSA-qq4c-hm99-979m/index.md)","id":"GHSA-qq4c-hm99-979m","markdown":"https://insights.sbomify.com/GHSA-qq4c-hm99-979m/index.md","name":"GHSA-qq4c-hm99-979m","record":{"aliases":["RUSTSEC-2025-0050"],"analysis":{"component_type":"library","fix_type":"patch","impacts":["denial_of_service","code_execution"],"network_reachable":"unknown","non_default_config":false,"product_category":"Rust IdMap library","requires_auth":"none","summary":"A flaw in the IdMap library's from_iter constructor can cause uninitialized memory to be freed, leading to crashes or potential code execution.","user_interaction":"not_required","vuln_class":"memory_corruption"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"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)","ecosystems":["crates.io"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"IdMap from_iter may lead to uninitialized memory being freed on drop","id":"GHSA-qq4c-hm99-979m","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"memory_corruption","year":"2025"},"n_packages":3,"n_references":null,"packages":[{"ecosystem":"crates.io","fixed":["0.2.2"],"introduced":["0.1.6"],"last_affected":[],"package":"id-map","purl":null,"source":"GHSA-qq4c-hm99-979m"},{"ecosystem":"crates.io","fixed":["0.2.2"],"introduced":["0.1.6"],"last_affected":[],"package":"id-map","purl":"pkg:cargo/id-map","source":"GHSA-qq4c-hm99-979m"},{"ecosystem":"crates.io","fixed":["0.2.2"],"introduced":["0.1.6"],"last_affected":[],"package":"id-map","purl":"pkg:cargo/id-map","source":"RUSTSEC-2025-0050"}],"products":null,"published":"2025-08-14","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"open","licence":"CC0 1.0","name":"RustSec","prefix":"RUSTSEC"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"A flaw in the IdMap library's from_iter constructor can cause uninitialized memory to be freed, leading to crashes or potential code execution.","url":"https://insights.sbomify.com/GHSA-qq4c-hm99-979m/"}