Use After Free Affecting pyo3 package, versions >=0.22.0 <0.22.4


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    EPSS
    0.05% (17th 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 ID SNYK-RUST-PYO3-8220283
  • published 16 Oct 2024
  • disclosed 15 Oct 2024
  • credit Unknown

How to fix?

Upgrade pyo3 to version 0.22.4 or higher.

Overview

pyo3 is a package that provides Rust bindings for Python. This includes running and interacting with Python code from a Rust binary, as well as writing native Python modules.

Affected versions of this package are vulnerable to Use After Free via the functions get_object_borrowed, upgrade_borrowed,upgrade_borrowed_as ,upgrade_borrowed_as_exact and upgrade_borrowed_as_unchecked . An attacker can manipulate memory and access or modify freed memory locations by exploiting the unsound nature of these functions.

References

CVSS Scores

version 4.0
version 3.1
Expand this section

Snyk

Recommended
4.8 medium
  • Attack Vector (AV)
    Local
  • Attack Complexity (AC)
    Low
  • Attack Requirements (AT)
    None
  • Privileges Required (PR)
    Low
  • User Interaction (UI)
    None
  • Confidentiality (VC)
    Low
  • Integrity (VI)
    Low
  • Availability (VA)
    Low
  • Confidentiality (SC)
    None
  • Integrity (SI)
    None
  • Availability (SA)
    None