Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. pyo3
  4. ›
  5. GHSA-47qc-857f-7w7f

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

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

References

  • github.com/PyO3/pyo3
  • github.com/PyO3/pyo3/commit/75abd8602896b350fd8c778e52e0a74b4644ccca
  • github.com/PyO3/pyo3/pull/5807
  • github.com/PyO3/pyo3/releases/tag/v0.28.2
  • github.com/advisories/GHSA-47qc-857f-7w7f
  • rustsec.org/advisories/RUSTSEC-2026-0013.html

Code Behaviors & Features

Detect and mitigate GHSA-47qc-857f-7w7f with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 0.28.0 before 0.28.2

Fixed versions

  • 0.28.2

Solution

Upgrade to version 0.28.2 or above.

Impact 8.1 HIGH

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-843: Access of Resource Using Incompatible Type ('Type Confusion')

Source file

cargo/pyo3/GHSA-47qc-857f-7w7f.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 25 Mar 2026 00:17:16 +0000.