Skip to content
OpenAdvisories

Package · crates.io

pyo3

7 known vulnerabilities.

7 results · Feed

  • Medium —

    PyO3 has a missing `Sync` bound on `PyCFunction::new_closure` closures

    `PyCFunction::new_closure` (and the temporary `new_closure_bound` complement in the 0.21–0.22 series) required the supplied closure to be `Send + 'static` but not `Sync`. The resulting `PyCFunction` is a Python callable that can be invoked from any Python thr…

  • High —

    PyO3 has an Out-of-bounds Read in `nth` / `nth_back` for `PyList` and `PyTuple` iterators

    PyO3 0.24.0 added optimized implementations of `Iterator::nth` and `DoubleEndedIterator::nth_back` for the `BoundListIterator` and `BoundTupleIterator` types. These implementations computed the target index using unchecked `usize` addition (`index + n`) befor…

  • High —

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

    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 attemptin…

  • Low —

    PyO3 Risk of buffer overflow in `PyString::from_object`

    `PyString::from_object` took `&str` arguments and forwarded them directly to the Python C API without checking for terminating nul bytes. This could lead the Python interpreter to read beyond the end of the `&str` data and potentially leak contents of the out…

  • Medium —

    Build corruption when using `PYO3_CONFIG_FILE` environment variable

    In PyO3 0.23.0 the `PYO3_CONFIG_FILE` environment variable used to configure builds regressed such that changing the environment variable would no longer trigger PyO3 to reconfigure and recompile. In combination with workflows using tools such as `maturin` to…

  • Medium 5.3

    Pyo3: risk of use-after-free in `borrowed` reads from python weak references

    A flaw was found in PyO3. This vulnerability causes a use-after-free issue, potentially leading to memory corruption or crashes via unsound borrowing from weak Python references.

  • Medium 5.5

    Reference counting error in pyo3

    An issue was discovered in the pyo3 crate before 0.12.4 for Rust. There is a reference-counting error and use-after-free in From<Py<T>>.