{"id":"GHSA-pph8-gcv7-4qj5","revision":"f10667ecb30b40c9989c4683bde376de","records":[{"revision":"f10667ecb30b40c9989c4683bde376de","observedAt":"2026-10-24T13:19:54.901+00:00","statement":{"source":"osv","id":"GHSA-pph8-gcv7-4qj5","aliases":["RUSTSEC-2025-0020"],"title":"PyO3 Risk of buffer overflow in `PyString::from_object`","description":"`PyString::from_object` took `&str` 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 `&str` 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 `&CStr` arguments.","state":0,"publishedAt":"2025-04-02T13:19:19+00:00","modifiedAt":"2026-09-10T03:50:23.9761635+00:00","affected":[{"ecosystem":"crates.io","name":"pyo3","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0.1.0"},{"kind":"fixed","version":"0.24.1"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V4","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:P","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"LOW"}],"references":["https://github.com/PyO3/pyo3/issues/5005","https://github.com/PyO3/pyo3/pull/5008","https://github.com/PyO3/pyo3","https://rustsec.org/advisories/RUSTSEC-2025-0020.html"],"sourceUrl":"https://github.com/advisories/GHSA-pph8-gcv7-4qj5","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-pph8-gcv7-4qj5","identifiers":["GHSA-pph8-gcv7-4qj5","RUSTSEC-2025-0020"]},"retained":false,"historicalAffected":[]}],"coverage":[]}