CVE-2024-9979: PyO3 has a risk of use-after-free in `borrowed` reads from Python weak references
5.3
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.25705%
CWE
Published
10/15/2024
Updated
10/15/2024
KEV Status
No
Technology
Rust
Technical Details
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
pyo3 | rust | >= 0.22.0, < 0.22.4 | 0.22.4 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
- The RustSec advisory explicitly lists these functions under 'Affected Functions' with vulnerable version ranges.
- The GHSA description specifies that 'borrowed' read methods from weak references are unsound.
- The PR #4590 shows these methods were patched to leak references instead of borrowing.
- All functions follow the pattern of returning borrowed references from weakrefs without ownership, violating Rust's safety guarantees when underlying Python objects might be collected.