Use After Free Affecting lru package, versions <0.7.1


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.1% (43rd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Use After Free vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-RUST-LRU-2326707
  • published27 Dec 2021
  • disclosed27 Dec 2021
  • creditoherrala

Introduced: 27 Dec 2021

CVE-2021-45720  (opens in a new tab)
CWE-416  (opens in a new tab)

How to fix?

Upgrade lru to version 0.7.1 or higher.

Overview

lru is an an implementation of a LRU cache. The cache supports put, get, get_mut and pop operations, all of which are O(1).

Affected versions of this package are vulnerable to Use After Free via iter and iter_mut functions, both iterators give references to key and value. Calling specific functions, like pop(), will remove and free the value, but it's still possible to access the reference of value which is already dropped.

CVSS Scores

version 3.1