Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. lru
  4. ›
  5. CVE-2021-45720

CVE-2021-45720: Use After Free in lru

January 7, 2022 (updated June 13, 2023)

Lru crate has two functions for getting an iterator. Both iterators give references to key and value. Calling specific functions, like pop(), will remove and free the value, and but it’s still possible to access the reference of value which is already dropped causing use after free.

References

  • github.com/advisories/GHSA-v362-2895-h9r2
  • github.com/jeromefroe/lru-rs.git
  • github.com/jeromefroe/lru-rs/issues/120
  • nvd.nist.gov/vuln/detail/CVE-2021-45720
  • raw.githubusercontent.com/rustsec/advisory-db/main/crates/lru/RUSTSEC-2021-0130.md
  • rustsec.org/advisories/RUSTSEC-2021-0130.html

Code Behaviors & Features

Detect and mitigate CVE-2021-45720 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 before 0.7.1

Fixed versions

  • 0.7.1

Solution

Upgrade to version 0.7.1 or above.

Impact 7.5 HIGH

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

Learn more about CVSS

Weakness

  • CWE-416: Use After Free

Source file

cargo/lru/CVE-2021-45720.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:24 +0000.