Read the docs
TI-2025-43627 Aliases GHSA-pph8-gcv7-4qj5

PyO3 Risk of buffer overflow in `PyString::from_object`

Priority LOW 38CWE-125Published · Updated

Key facts

Attack vector
—
Privileges required
—
User interaction
—
Attack complexity
—
Impact type
—
Confidentiality · integrity · availability
—
Fix status
Fixed

No CVSS vector from any source. Fix status from GitHub.

Summary

`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). In 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.

Why it matters now

Fix Fixed pyo3 (crates.io): 0.24.1

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
—pyo3 (crates.io)0.1.0 to before 0.24.10.24.1Patch availableGHSA-pph8-gcv7-4qj5
  • pyo3 (crates.io) Vendor— Affected 0.1.0 to before 0.24.1 Fixed in 0.24.1 Patch available GHSA-pph8-gcv7-4qj5

Remediation

  • Fix · GHSA-pph8-gcv7-4qj5 pyo3 (crates.io) Fixed in 0.24.1 Advisory →

Timeline

  1. 2026-10-03 Threatist record created from GHSA-pph8-gcv7-4qj5

References

Sources

This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences