Files
vuln-osv/data/crates.io/RUSTSEC-2026-0177.json

1 line
1.9 KiB
JSON
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{"schema_version":"1.7.5","id":"RUSTSEC-2026-0177","published":"2026-06-11T12:00:00Z","modified":"2026-06-13T06:30:04.499559191Z","aliases":["GHSA-chgr-c6px-7xpp"],"summary":"Missing `Sync` bound on `PyCFunction::new_closure` closures","details":"`PyCFunction::new_closure` (and the temporary `new_closure_bound` complement in\nthe 0.21–0.22 series) required the supplied closure to be `Send + 'static` but\nnot `Sync`. The resulting `PyCFunction` is a Python callable that can be\ninvoked from any Python thread, which means the closure may be called\nconcurrently from multiple threads, and needs a `Sync` bound to prevent\npossible data races.\n\nThe problem exists under all Python versions but is particularly vulnerable under\nthe newer free-threaded Python variant, which do not have serial execution\nimposed by the Global Interpreter Lock. Under releases protected by the GIL,\nthe ability to \"detach\" from the Python interpreter temporarily inside the closure\n(e.g. by `Python::detach`) makes it possible for interleaved and/or concurrent\nexecution of various portions of the closure.\n\nPyO3 0.29.0 added a `Sync` bound to close this thread-safety bug.","affected":[{"package":{"name":"pyo3","ecosystem":"crates.io","purl":"pkg:cargo/pyo3"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"0.29.0"}]}],"ecosystem_specific":{"affected_functions":null,"affects":{"arch":[],"functions":["pyo3::types::PyCFunction::new_closure","pyo3::types::PyCFunction::new_closure_bound"],"os":[]}},"database_specific":{"categories":["thread-safety"],"cvss":null,"informational":null,"source":"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0177.json"}}],"references":[{"type":"PACKAGE","url":"https://crates.io/crates/pyo3"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2026-0177.html"},{"type":"WEB","url":"https://github.com/PyO3/pyo3/pull/6096"}],"database_specific":{"license":"CC0-1.0"}}