---
id: CVE-2024-9979
title: 'Pyo3: risk of use-after-free in `borrowed` reads from python weak references'
summary: >-
  A flaw was found in PyO3. This vulnerability causes a use-after-free issue,
  potentially leading to memory corruption or crashes via unsound borrowing from
  weak Python references.
severity: medium
cvss: 5.3
cvssVector: 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L'
cvssSource: cna
cwe:
  - CWE-416
vendor: Red Hat
product: pyo3
affected:
  - pyo3 >= 0.22.0 < 0.22.4
  - python3.11-nh3
  - python3.11-rpds-py
  - python-rpds-py (all versions)
  - python3.11-cryptography
  - python3.12-cryptography
  - python3.11-cryptography
  - python3.12-cryptography
ssvc:
  exploitation: none
  automatable: 'no'
  technicalImpact: partial
  timestamp: '2024-10-15T14:19:04.359472Z'
published: '2024-10-15'
updated: '2026-11-05'
sourceUpdated: '2026-11-05T14:45:39.461Z'
source: CVEORG
sourceUrl: 'https://www.cve.org/CVERecord?id=CVE-2024-9979'
references:
  - url: 'https://access.redhat.com/security/cve/CVE-2024-9979'
  - url: 'https://bugzilla.redhat.com/show_bug.cgi?id=2318646'
    label: RHBZ#2318646
  - url: 'https://crates.io/crates/pyo3'
  - url: 'https://github.com/PyO3/pyo3/pull/4590'
  - url: 'https://rustsec.org/advisories/RUSTSEC-2024-0378.html'
tags:
  - cve.org
epss: 0.00206
epssPercentile: 0.10644
ingestedAt: '2026-11-05T21:36:00.886Z'
---

## Overview

A flaw was found in PyO3. This vulnerability causes a use-after-free issue, potentially leading to memory corruption or crashes via unsound borrowing from weak Python references.

## Affected

- `pyo3 >= 0.22.0 < 0.22.4`
- `python3.11-nh3`
- `python3.11-rpds-py`
- `python-rpds-py (all versions)`
- `python3.11-cryptography`
- `python3.12-cryptography`
- `python3.11-cryptography`
- `python3.12-cryptography`

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.

### Workarounds

Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.
