{"answers":{"affected":"3 open source packages ship an affected version, including pyo3.","exploited":"There is no known exploitation of GHSA-pph8-gcv7-4qj5 in the wild and no public exploit code.","fix":"Upgrade pyo3 to 0.24.1 or later.","what":"GHSA-pph8-gcv7-4qj5 is a memory corruption vulnerability in pyo3, published on 1 Apr 2025."},"fix_prompt":"Check this codebase for GHSA-pph8-gcv7-4qj5 and fix it if it is affected.\n\nWhat it is: GHSA-pph8-gcv7-4qj5 is a memory corruption vulnerability in pyo3, published on 1 Apr 2025. \nExploitation: There is no known exploitation of GHSA-pph8-gcv7-4qj5 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- pyo3 (crates.io): affected from 0.0.0-0; fixed in 0.24.1\n- pyo3 (crates.io): affected from 0.1.0; fixed in 0.24.1\n- pyo3 (crates.io): affected from 0.1.0; fixed in 0.24.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-pph8-gcv7-4qj5/ (Markdown: https://insights.sbomify.com/GHSA-pph8-gcv7-4qj5/index.md)","id":"GHSA-pph8-gcv7-4qj5","markdown":"https://insights.sbomify.com/GHSA-pph8-gcv7-4qj5/index.md","name":"GHSA-pph8-gcv7-4qj5","record":{"aliases":["RUSTSEC-2025-0020"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_read"],"network_reachable":"unknown","non_default_config":false,"product_category":"Rust Python bindings","requires_auth":"none","summary":"Attackers can trigger a buffer overflow in PyString::from_object to leak memory contents via Python exceptions, affecting Rust applications using PyO3.","user_interaction":"not_required","vuln_class":"memory_corruption"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"`PyString::from_object` took `\u0026str` arguments and forwarded them directly to the Python C API without checking for terminating nul bytes. This could lead the Python interpreter to read beyond the end of the `\u0026str` data and potentially leak contents of the out-of-bounds read (by raising a Python exception containing a copy of the data including the overflow).\n\nIn PyO3 0.24.1 this function will now allocate a `CString` to guarantee a terminating nul bytes. PyO3 0.25 will likely offer an alternative API which takes `\u0026CStr` arguments.","ecosystems":["crates.io"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"Risk of buffer overflow in `PyString::from_object`","id":"GHSA-pph8-gcv7-4qj5","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"memory_corruption","year":"2025"},"n_packages":3,"n_references":null,"packages":[{"ecosystem":"crates.io","fixed":["0.24.1"],"introduced":["0.0.0-0"],"last_affected":[],"package":"pyo3","purl":"pkg:cargo/pyo3","source":"RUSTSEC-2025-0020"},{"ecosystem":"crates.io","fixed":["0.24.1"],"introduced":["0.1.0"],"last_affected":[],"package":"pyo3","purl":null,"source":"GHSA-pph8-gcv7-4qj5"},{"ecosystem":"crates.io","fixed":["0.24.1"],"introduced":["0.1.0"],"last_affected":[],"package":"pyo3","purl":"pkg:cargo/pyo3","source":"GHSA-pph8-gcv7-4qj5"}],"products":null,"published":"2025-04-01","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"open","licence":"CC0 1.0","name":"RustSec","prefix":"RUSTSEC"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Attackers can trigger a buffer overflow in PyString::from_object to leak memory contents via Python exceptions, affecting Rust applications using PyO3.","url":"https://insights.sbomify.com/GHSA-pph8-gcv7-4qj5/"}