PyO3 has type confusion when accessing data from sublasses of subclasses of native types with `abi3` feature
High severity
GitHub Reviewed
Published
Feb 19, 2026
to the GitHub Advisory Database
•
Updated Feb 19, 2026
Description
Published to the GitHub Advisory Database
Feb 19, 2026
Reviewed
Feb 19, 2026
Last updated
Feb 19, 2026
PyO3 0.28.1 added support for
#[pyclass(extends=PyList)] struct NativeSub(and other native types) when targeting Python 3.12 and up with theabi3feature.It was discovered that subclasses of such classes would use the type of the subclass when attempting to access to data of
NativeSubcontained within Python objects, amounting to memory corruption.PyO3 0.28.2 fixed the issue by using the type of (e.g.)
NativeSubcorrectly.References