Monitor vulnerabilities like this one.
Sign up free to get alerted when software you use is affected.
7.2
PyO3: Malicious code can corrupt memory when accessing PyList data
GHSA-47qc-857f-7w7f
Summary
PyO3, a Rust library for creating Python extensions, has a bug that allows an attacker to corrupt memory when accessing data from subclasses of certain native types. This bug was fixed in version 0.28.2, so update to this version to ensure security. If you can't update immediately, consider temporarily disabling the `abi3` feature to mitigate the risk.
What to do
- Update pyo3 to version 0.28.2.
Affected software
| Vendor | Product | Affected versions | Fix available |
|---|---|---|---|
| – | pyo3 | > 0.28.0 , <= 0.28.2 | 0.28.2 |
Original title
PyO3 has type confusion when accessing data from sublasses of subclasses of native types with `abi3` feature
Original description
PyO3 0.28.1 added support for `#[pyclass(extends=PyList)] struct NativeSub` (and other native types) when targeting Python 3.12 and up with the `abi3` feature.
It was discovered that subclasses of such classes would use the type of the subclass when attempting to access to data of `NativeSub` contained within Python objects, amounting to memory corruption.
PyO3 0.28.2 fixed the issue by using the type of (e.g.) `NativeSub` correctly.
It was discovered that subclasses of such classes would use the type of the subclass when attempting to access to data of `NativeSub` contained within Python objects, amounting to memory corruption.
PyO3 0.28.2 fixed the issue by using the type of (e.g.) `NativeSub` correctly.
ghsa CVSS4.0
7.2
Vulnerability type
CWE-843
Type Confusion
Published: 19 Feb 2026 · Updated: 7 Mar 2026 · First seen: 6 Mar 2026