{"id":"CVE-2024-9979","aliases":["CVE-2024-9979","GHSA-6jgw-rgmm-7cv6","RUSTSEC-2024-0378"],"related":[],"kind":"vulnerability","state":"published","title":"Pyo3: risk of use-after-free in `borrowed` reads from python weak references","summary":"A flaw was found in PyO3. This vulnerability causes a use-after-free issue, potentially leading to memory corruption or crashes via unsound borrowing from weak Python references.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"A flaw was found in PyO3. This vulnerability causes a use-after-free issue, potentially leading to memory corruption or crashes via unsound borrowing from weak Python references.","source":"cvelist"},{"lang":"en","text":"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.\n\nIn 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Se encontró una falla en PyO3. Esta vulnerabilidad provoca un problema de use-after-free, que puede provocar daños en la memoria o fallas debido a un préstamo incorrecto de referencias débiles de Python.","source":"nvd"}],"published":"2024-10-12T12:00:00.000Z","modified":"2026-11-24T07:17:16.330Z","severity":{"scorer":"redhat","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"redhat","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"MEDIUM"}],"cwes":["CWE-416"],"affected":[{"ranges":[{"type":"semver","introduced":"0.22.0","fixed":"0.22.4","status":"affected"}],"package":"pyo3","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Ansible Automation Platform 2","package":"python3.11-nh3","cpe":"cpe:/a:redhat:ansible_automation_platform:2","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Ansible Automation Platform 2","package":"python3.11-rpds-py","cpe":"cpe:/a:redhat:ansible_automation_platform:2","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Enterprise Linux 10","package":"python-rpds-py","cpe":"cpe:/o:redhat:enterprise_linux:10","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Enterprise Linux 8","package":"python3.11-cryptography","cpe":"cpe:/o:redhat:enterprise_linux:8","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Enterprise Linux 8","package":"python3.12-cryptography","cpe":"cpe:/o:redhat:enterprise_linux:8","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Enterprise Linux 9","package":"python3.11-cryptography","cpe":"cpe:/o:redhat:enterprise_linux:9","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Enterprise Linux 9","package":"python3.12-cryptography","cpe":"cpe:/o:redhat:enterprise_linux:9","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.22.0","status":"affected","fixed":"0.22.4"}],"ecosystem":"crates.io","package":"pyo3","purl":"pkg:cargo/pyo3","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.22.0","status":"affected","fixed":"0.22.4"}],"ecosystem":"crates.io","package":"pyo3","purl":"pkg:cargo/pyo3","source":"rustsec"}],"references":[{"url":"https://access.redhat.com/security/cve/CVE-2024-9979","tags":["vdb-entry","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2318646","tags":["issue-tracking","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://crates.io/crates/pyo3","tags":["package","web"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://github.com/PyO3/pyo3/pull/4590","tags":["web"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2024-0378.html","tags":["advisory","web"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-9979","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/PyO3/pyo3","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"redhat","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-10-15T14:19:04.359Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-9979","url":"https://www.cve.org/CVERecord?id=CVE-2024-9979","licence":"CVE Terms of Use","modified":"2026-11-24T06:23:35.162Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-6jgw-rgmm-7cv6","url":"https://github.com/advisories/GHSA-6jgw-rgmm-7cv6","licence":"CC-BY-4.0","modified":"2025-10-28T06:29:04.991Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2024-0378","url":"https://rustsec.org/advisories/RUSTSEC-2024-0378.html","licence":"CC0-1.0","modified":"2025-10-28T06:29:04.991Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-9979","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-9979","licence":"Public domain","modified":"2026-11-24T07:17:16.330Z"}],"updatedAt":"2026-11-25T22:58:46.758Z","epss":{"score":0.00239,"percentile":0.16022,"date":"2026-12-02T12:00:21.000Z"}}