From 85079c542b9626e28c21f2cd1a16f92f8b83d027 Mon Sep 17 00:00:00 2001 From: Vikrant Puppala Date: Fri, 3 Jul 2026 07:07:14 +0000 Subject: [PATCH] fix(security): suppress unreachable pyo3 0.26 RustSec advisories The Security Scan (osv-scanner) started failing on RUSTSEC-2026-0176 and RUSTSEC-2026-0177, both against pyo3 0.26.0. The fixed release is pyo3 0.29.0, but arrow-pyarrow (through arrow 59) still caps pyo3 at ^0.28, so we cannot upgrade yet. Neither advisory is reachable from the pyo3 sub-crate: - RUSTSEC-2026-0176 (OOB read in Bound{List,Tuple}Iterator::nth / nth_back): we never iterate a Python list/tuple via pyo3's Bound iterators; all .iter()/.into_iter()/.nth() uses are over Rust std collections. - RUSTSEC-2026-0177 (missing Sync bound on PyCFunction::new_closure): we never call new_closure / new_closure_bound. Add documented [[IgnoredVulns]] entries with justifications and a 2026-10-01 expiry to revisit once arrow-pyarrow supports pyo3 0.29. Verified locally with osv-scanner v2.3.8: both advisories are filtered and the scan exits 0. Co-authored-by: Isaac Signed-off-by: Vikrant Puppala --- osv-scanner.toml | 25 ++++++++++++++++++++++++- pyo3/Cargo.toml | 6 ++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/osv-scanner.toml b/osv-scanner.toml index 8fdc6643..1ac82aa1 100644 --- a/osv-scanner.toml +++ b/osv-scanner.toml @@ -23,4 +23,27 @@ # separately so this file stays empty on the initial landing; once we # have real suppressions to enforce against, wire it up. -# (intentionally empty — add entries here as needed) +[[IgnoredVulns]] +id = "RUSTSEC-2026-0176" +# pyo3 0.24.0..=0.28.x: out-of-bounds read in +# Bound{List,Tuple}Iterator::nth / nth_back (unchecked usize add/sub +# before the bounds check). Fixed in pyo3 0.29.0. +# Justification: the pyo3 sub-crate never iterates a Python list or +# tuple via pyo3's Bound iterators, and never calls nth / nth_back on +# one. All `.iter()` / `.into_iter()` / `.nth()` uses in pyo3/src are +# over Rust std collections (Vec / slice), which are unaffected. We +# cannot bump to the fixed 0.29 yet because arrow-pyarrow (through +# arrow 59) still caps pyo3 at ^0.28. +# Expiry: 2026-10-01 (revisit once arrow-pyarrow supports pyo3 0.29) + +[[IgnoredVulns]] +id = "RUSTSEC-2026-0177" +# pyo3 <=0.28.x: PyCFunction::new_closure accepted closures that were +# Send + 'static but not Sync, allowing concurrent invocation of a +# non-Sync closure (data race, notably under free-threaded Python). +# Fixed in pyo3 0.29.0. +# Justification: this crate does not call PyCFunction::new_closure (or +# new_closure_bound) anywhere — we expose #[pyclass] / #[pymethods] +# types, not dynamically-built C closures. Same 0.29 upgrade blocker +# as RUSTSEC-2026-0176 (arrow-pyarrow caps pyo3 at ^0.28). +# Expiry: 2026-10-01 (revisit once arrow-pyarrow supports pyo3 0.29) diff --git a/pyo3/Cargo.toml b/pyo3/Cargo.toml index 179e1fcd..10c7639a 100644 --- a/pyo3/Cargo.toml +++ b/pyo3/Cargo.toml @@ -72,6 +72,12 @@ databricks-sql-kernel = { path = "..", default-features = false, features = ["tl # step with `requires-python = ">=3.9"` in pyproject.toml; bumping # both together avoids shipping a wheel whose ABI tag advertises an # interpreter the package no longer claims to support. +# +# Pinned to 0.26 to match `arrow-pyarrow` (the arrow ecosystem still +# caps pyo3 at ^0.28 as of arrow 59, so we cannot yet reach the 0.29 +# release that fixes RUSTSEC-2026-0176 / -0177). Neither advisory is +# reachable from this crate — see the [[IgnoredVulns]] justifications +# in ../osv-scanner.toml. Bump to 0.29 once arrow-pyarrow supports it. pyo3 = { version = "0.26", features = ["extension-module", "abi3-py39"] } # Multi-thread runtime — one per Session, owned on the Rust side.