RUSTSEC-2024-0378

Source
https://rustsec.org/advisories/RUSTSEC-2024-0378
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2024-0378.json
JSON Data
https://api.osv.dev/v1/vulns/RUSTSEC-2024-0378
Published
2024-10-12T12:00:00Z
Modified
2024-10-14T19:18:55Z
Summary
Risk of use-after-free in `borrowed` reads from Python weak references
Details

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
{
    "license": "CC0-1.0"
}
References

Affected packages

crates.io / pyo3

Package

Affected ranges

Type
SEMVER
Events
Introduced
0.22.0
Fixed
0.22.4

Ecosystem specific

{
    "affected_functions": null,
    "affects": {
        "os": [],
        "functions": [
            "pyo3::types::PyWeakrefMethods::get_object_borrowed",
            "pyo3::types::PyWeakrefMethods::upgrade_borrowed",
            "pyo3::types::PyWeakrefMethods::upgrade_borrowed_as",
            "pyo3::types::PyWeakrefMethods::upgrade_borrowed_as_exact",
            "pyo3::types::PyWeakrefMethods::upgrade_borrowed_as_unchecked"
        ],
        "arch": []
    }
}

Database specific

{
    "cvss": null,
    "informational": null,
    "categories": [
        "memory-corruption"
    ]
}