
Cloud Vulnerability DB
A community-led vulnerabilities database
A vulnerability (CVE-2024-9979) was discovered in PyO3, affecting versions 0.22.0 to 0.22.3. The flaw relates to unsound borrowing from weak Python references, which could potentially lead to memory corruption or crashes. The vulnerability was disclosed on October 15, 2024 (NVD, RustSec).
The vulnerability stems from functions that read 'borrowed' values from Python weak references. The fundamental issue is that weak references do not maintain ownership of the referenced value, meaning the last strong reference could be cleared at any point, resulting in a dangling reference. The vulnerability has been assigned a CVSS v3.1 base score of 5.3 (Medium) with the vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L and is classified as CWE-416 (Use After Free) (NVD).
If exploited, this vulnerability could lead to memory corruption or application crashes due to use-after-free conditions when accessing Python weak references. The issue specifically affects scenarios where borrowed values are read from weak references, potentially compromising the stability and security of applications using affected PyO3 versions (RustSec).
The issue has been addressed in PyO3 version 0.22.4, where the affected functions have been deprecated and patched to leak a strong reference as a temporary mitigation. The functions will be completely removed in PyO3 0.23. Users are strongly advised to upgrade to version 0.22.4 or later and move away from using the deprecated borrowed reference methods (RustSec, GitHub PR).
The security community has noted concerns about the mitigation strategy. While leaking references is considered the lesser evil compared to use-after-free vulnerabilities, it has been pointed out that Python's reference counts lack overflow checking, which could potentially lead to other security issues, particularly on 32-bit platforms (GitHub PR).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."