GHSA-f8x4-f32r-w556

Suggest an improvement
Source
https://github.com/advisories/GHSA-f8x4-f32r-w556
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/10/GHSA-f8x4-f32r-w556/GHSA-f8x4-f32r-w556.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-f8x4-f32r-w556
Withdrawn
2024-10-15T17:13:46Z
Published
2024-10-15T14:08:25Z
Modified
2024-10-15T17:13:46Z
Severity
  • 4.8 (Medium) CVSS_V4 - CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N CVSS Calculator
Summary
Duplicate Advisory: PyO3 has a risk of use-after-free in `borrowed` reads from Python weak references
Details

Duplicate Advisory

This advisory has been withdrawn because it is a duplicate of GHSA-6jgw-rgmm-7cv6. This link is maintained to preserve external references.

Original Advisory

The family of functions to read "borrowed" values from Python weak references were fundamentally unsound, because the weak reference does itself not have ownership of the value. At any point the last strong reference could be cleared and the borrowed value would become dangling.

In PyO3 0.22.4 these functions have all been deprecated and patched to leak a strong reference as a mitigation. PyO3 0.23 will remove these functions entirely.

Database specific
{
    "cwe_ids":  [
        "CWE-416"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2024-10-15T14:08:25Z",
    "nvd_published_at":  null,
    "severity":  "MODERATE"
}
References

Affected packages

crates.io / pyo3

Package

Affected ranges

Type
SEMVER
Events
Introduced
0.22.0
Fixed
0.22.4

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/10/GHSA-f8x4-f32r-w556/GHSA-f8x4-f32r-w556.json"