{"id":"RUSTSEC-2024-0378","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\nwere fundamentally unsound, because the weak reference does itself not have\nownership of the value. At any point the last strong reference could\nbe cleared and the borrowed value would become dangling.\n\nIn PyO3 0.22.4 these functions have all been deprecated and patched to leak a\nstrong reference as a mitigation. PyO3 0.23 will remove these functions entirely.","aliases":["CVE-2024-9979","GHSA-6jgw-rgmm-7cv6"],"modified":"2025-10-28T06:29:04.991816Z","published":"2024-10-12T12:00:00Z","database_specific":{"license":"CC0-1.0"},"references":[{"type":"PACKAGE","url":"https://crates.io/crates/pyo3"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2024-0378.html"},{"type":"WEB","url":"https://github.com/PyO3/pyo3/pull/4590"}],"affected":[{"package":{"name":"pyo3","ecosystem":"crates.io","purl":"pkg:cargo/pyo3"},"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":{"informational":null,"categories":["memory-corruption"],"cvss":null,"source":"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2024-0378.json"}}],"schema_version":"1.7.3"}