Skip to content

Commit 88cf387

Browse files
authored
add advisory for issue found in PyO3 0.28.0 (#2651)
1 parent 532daba commit 88cf387

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

crates/pyo3/RUSTSEC-0000-0000.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
```toml
2+
[advisory]
3+
id = "RUSTSEC-0000-0000"
4+
package = "pyo3"
5+
date = "2026-02-18"
6+
url = "https://github.com/PyO3/pyo3/pull/5807#issuecomment-3913251784"
7+
categories = ["memory-corruption"]
8+
keywords = ["memory-corruption"]
9+
10+
11+
[versions]
12+
patched = [">= 0.28.2"]
13+
unaffected = ["< 0.28.0"]
14+
```
15+
16+
# Type confusion when accessing data from sublasses of subclasses of native types with `abi3` feature targeting Python 3.12 and up
17+
18+
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.
19+
20+
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.
21+
22+
PyO3 0.28.2 fixed the issue by using the type of (e.g.) `NativeSub` correctly.

0 commit comments

Comments
 (0)