{"id":"RUSTSEC-2025-0020","revision":"95461db9132341c2a91f130ad493f02e","records":[{"revision":"95461db9132341c2a91f130ad493f02e","observedAt":"2026-10-24T13:19:54.901+00:00","statement":{"source":"osv","id":"RUSTSEC-2025-0020","aliases":["GHSA-pph8-gcv7-4qj5"],"title":"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-01T12:00:00+00:00","modifiedAt":"2025-10-28T06:29:25.695525+00:00","affected":[{"ecosystem":"crates.io","name":"pyo3","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0.0.0-0"},{"kind":"fixed","version":"0.24.1"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[],"references":["https://crates.io/crates/pyo3","https://rustsec.org/advisories/RUSTSEC-2025-0020.html","https://github.com/PyO3/pyo3/issues/5005"],"sourceUrl":"https://osv.dev/vulnerability/RUSTSEC-2025-0020","license":"OSV · upstream source license applies","key":"osv:RUSTSEC-2025-0020","identifiers":["RUSTSEC-2025-0020","GHSA-pph8-gcv7-4qj5"]},"retained":false,"historicalAffected":[]}],"coverage":[]}