Skip to content

← Public intelligence

crates.io package

id-map

Open actionable advisories and recorded vendor fixes. This public package view has no inventory attached and cannot establish whether your deployment is affected. A vendor fix never resolves your finding; verify your installed version and the source guidance.

Open advisories

1 actionable advisory, newest first. Withdrawn advisories and news are excluded. Coverage is partial.

  1. Medium, CVSS 6.9crates.ioPublished

    IdMap from_iter may lead to uninitialized memory being freed on drop

    GHSA-qq4c-hm99-979m

    Affected
    • crates.io id-map >= 0.1.6, < 0.2.2
    Fixed in
    0.2.2· Vendor fix available
    Issue
    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

    Recommended action: Upgrade to 0.2.2 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →