# GHSA-47qc-857f-7w7f: PyO3 has type confusion when accessing data from sublasses of subclasses of native types with `abi3` feature

- Severity: High (CVSS:4.0, scored by GitHub) `CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:U`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-02-18T12:00:00.000Z
- Modified: 2026-02-23T07:26:19.729Z
- Also known as: RUSTSEC-2026-0013
- Weaknesses: CWE-843

## 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.

(As written by GitHub Advisory Database.)

## Affected

- pyo3 (crates.io): from 0.28.0 before 0.28.2

## References

- <https://github.com/PyO3/pyo3/pull/5807#issuecomment-3913251784> (web)
- <https://github.com/PyO3/pyo3/commit/75abd8602896b350fd8c778e52e0a74b4644ccca> (web)
- <https://github.com/PyO3/pyo3> (package)
- <https://github.com/PyO3/pyo3/releases/tag/v0.28.2> (web)
- <https://rustsec.org/advisories/RUSTSEC-2026-0013.html> (advisory, web)
- <https://crates.io/crates/pyo3> (package)

## Sources

- GitHub Advisory Database: [GHSA-47qc-857f-7w7f](https://github.com/advisories/GHSA-47qc-857f-7w7f), CC-BY-4.0, modified 2026-02-23
- RustSec Advisory Database: [RUSTSEC-2026-0013](https://rustsec.org/advisories/RUSTSEC-2026-0013.html), CC0-1.0, modified 2026-02-23

---

Page: https://cve.day/GHSA-47qc-857f-7w7f · Whole record: https://cve.day/GHSA-47qc-857f-7w7f.json · Rebuilt by cve.day 2026-11-25T22:56:43.304Z
