Advisory

GHSA-47qc-857f-7w7f

Also known as: RUSTSEC-2026-0013

Summary

PyO3 has type confusion when accessing data from sublasses of subclasses of native types with abi3 feature

Details

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.

Severity

High Basis: The source's own band: HIGH

Dates

Published
2026-02-19 20:25 UTC
Modified
2026-02-23 07:26 UTC

Affected packages and fixes

pyo3

crates.io · All systems

Affected

  • introduced 0.28.0, fixed 0.28.2 (semver)

Fixed versions

0.28.2

Fix

  • Fixed version 0.28.2
    cargo update -p pyo3 --precise 0.28.2

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences