Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. id-map
  4. ›
  5. CVE-2021-30455

CVE-2021-30455: Double-free in id-map

August 25, 2021 (updated June 13, 2023)

The clone_from implementation for IdMap drops the values present in the map and then begins cloning values from the other map. If a .clone() call pancics, then the afformentioned dropped elements can be freed again. get_or_insert

get_or_insert reserves space for a value, before calling the user provided insertion function f. If the function f panics then uninitialized or previously freed memory can be dropped. remove_set

When removing a set of elements, ptr::drop_in_place is called on each of the element to be removed. If the Drop impl of one of these elements panics then the previously dropped elements can be dropped again.

References

  • github.com/advisories/GHSA-8gmx-cpcg-f8h5
  • github.com/andrewhickman/id-map
  • github.com/andrewhickman/id-map/issues/3
  • nvd.nist.gov/vuln/detail/CVE-2021-30455
  • rustsec.org/advisories/RUSTSEC-2021-0052.html

Code Behaviors & Features

Detect and mitigate CVE-2021-30455 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions up to 0.2.1

Solution

Unfortunately, there is no solution available yet.

Impact 9.8 CRITICAL

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-415: Double Free

Source file

cargo/id-map/CVE-2021-30455.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:38 +0000.