{"id":"GHSA-36hh-v3qg-5jq4","revision":"0c5bc02cd5fc44e3bde87d301f0ebfef","records":[{"revision":"0c5bc02cd5fc44e3bde87d301f0ebfef","observedAt":"2026-10-24T13:19:54.901+00:00","statement":{"source":"osv","id":"GHSA-36hh-v3qg-5jq4","aliases":["RUSTSEC-2026-0176"],"title":"PyO3 has an Out-of-bounds Read in `nth` / `nth_back` for `PyList` and `PyTuple` iterators","description":"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`) before bounds-checking against the sequence length, then read the element via `get_item_unchecked`.\n\nIn `nth` methods, a sufficiently large `n` (combined with a non-zero internal index) could cause the addition to overflow and wrap around, producing a small \"target index\" that passed the bounds check and enabling reads at the front of the `list` or `tuple` of elements previously yielded by the iterator.\n\nIn `nth_back` methods, a sufficiently large `n` could cause underflow in a similar fashion, however would instead allow reads of arbitrary memory past the end of the `list` or `tuple` storage.","state":0,"publishedAt":"2026-06-12T19:32:47+00:00","modifiedAt":"2026-09-10T03:51:07.6588036+00:00","affected":[{"ecosystem":"crates.io","name":"pyo3","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"0.29.0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V4","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://github.com/PyO3/pyo3/pull/6086","https://github.com/PyO3/pyo3","https://rustsec.org/advisories/RUSTSEC-2026-0176.html"],"sourceUrl":"https://github.com/advisories/GHSA-36hh-v3qg-5jq4","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-36hh-v3qg-5jq4","identifiers":["GHSA-36hh-v3qg-5jq4","RUSTSEC-2026-0176"]},"retained":false,"historicalAffected":[]}],"coverage":[]}