Skip to content

RUSTSEC-2026-0013: Type confusion when accessing data from sublasses of subclasses of native types with abi3 feature targeting Python 3.12 and up #101

@github-actions

Description

@github-actions
Details
Package pyo3
Version 0.28.0
URL PyO3/pyo3#5807 (comment)
Patched Versions >=0.28.2
Unaffected Versions <0.28.0

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions