Repository navigation
fix(security): bump pyo3 to 0.28.x in rust/boar_fast_filter (RUSTSEC-2025-0020 + RUSTSEC-2026-0013) - #275
Closed
cursor[bot] wants to merge 1 commit into
Closed
fix(security): bump pyo3 to 0.28.x in rust/boar_fast_filter (RUSTSEC-2025-0020 + RUSTSEC-2026-0013)#275cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
Mitigates RUSTSEC-2025-0020 (PyString::from_object buffer overflow,
fixed in pyo3 0.24.1) and RUSTSEC-2026-0013 (abi3 native-subclass
type confusion, fixed in pyo3 0.28.2). Bumps to the latest 0.28.x
line, picking up the fixed Cargo.lock transitives.
Verification on this branch:
- cd rust/boar_fast_filter && cargo check -> OK
- cargo clippy --all-targets -- -D warnings -> OK
- cargo build --release -> OK
- cargo test --release -> OK
- uv run pytest --deselect tests/test_scripts.py
(PS1 parser tests need pwsh; not present on
this Linux Cloud Agent VM) -> 918 passed, 5 skipped
No lib.rs changes required: existing API surface
(#[pyclass], #[pymethods], #[pymodule] with
Bound<'_, PyModule>, #[new] -> PyResult<Self>,
filter_batch returning Vec<usize>) is source-compatible
with pyo3 0.24..0.28; release build links cleanly.
Defensive Architecture: zero impact on database
locks - this crate is the in-process Rust prefilter
(regex + Luhn) used by pro/prefilter.py and
pro/worker_logic.py; it never touches DB connections,
file locks, or network sockets.
Co-authored-by: Fabio Tavares Leitão <[email protected]>
FabioLeitao
force-pushed
the
cursor/sre-automation-agent-protocol-9689
branch
from
May 3, 2026 17:52
dbec4ed to
acd69e5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Surgical, targeted bump of
pyo3inrust/boar_fast_filter/Cargo.tomlfrom0.23to0.28, regeneratingCargo.lock. No new shell scripts, nocheck-all.shrefactor — used the existing gate.What was wrong (RCA, Julia Evans style)
rust/boar_fast_filter/Cargo.tomlpinnedpyo3 = "0.23"and the lockfile resolved topyo3 v0.23.5. Two RustSec advisories apply:PyString::from_objectforwarded&strarguments to the Python C API without a guaranteed terminating null byte, allowing an out-of-bounds read (the buffer-overflow class the Slack message called out). Fixed inpyo3 0.24.1.#[pyclass(extends=PyList)]-style native subclasses withabi3on Python 3.12+ had a type-confusion that caused memory corruption. Fixed inpyo3 0.28.2.A previous attempt on a sibling branch went to
0.24.x, which only closes the first one. Since the operator already cares aboutabi3posture (per ADR-0018 / ADR-0019), going to0.28.3in one move closes both, and the API surface this crate uses is source-compatible.The fix
Cargo.lockregenerated viacargo update -p pyo3:pyo3 v0.23.5 -> v0.28.3pyo3-build-config / pyo3-ffi / pyo3-macros{,-backend} 0.23.5 -> 0.28.3target-lexicon 0.12 -> 0.13; obsolete transitives (autocfg,cfg-if,indoc,memoffset,rustversion,unindent) dropped.src/lib.rsis untouched:#[pyclass],#[pymethods],#[pymodule] fn boar_fast_filter(_py: Python<'_>, m: &Bound<'_, PyModule>),#[new] -> PyResult<Self>, andfilter_batch(&self, batch: Vec<String>) -> PyResult<Vec<usize>>are source-compatible acrosspyo3 0.24..0.28.Defensive Architecture / no-regression check
Per the Defensive Scanning Manifesto and Art of the Fallback docs:
pro/prefilter.py,pro/engine.py,pro/worker_logic.py. It does not open DB connections, take file locks, or touch network sockets.FastFilter().filter_batch(list[str]) -> list[int]), sotests/test_rust_bridge.pysemantics are preserved.pytest.importorskip("boar_fast_filter")and the runtime gracefully degrades to the pure-Python prefilter when the extension is absent (Art of the Fallback).Verification (run on this branch, Linux Cloud Agent)
cd rust/boar_fast_filter && cargo checkcargo clippy --all-targets -- -D warningscargo build --releasecargo test --releaseuv run pytest --deselect tests/test_scripts.pyThe 35 failures in
tests/test_scripts.py::test_*_ps1_syntaxreproduce onmainwithout this diff — they are pre-existing and only happen becausepwshis not installed on this Linux Cloud Agent VM (the test isparse-onlyvia PowerShell). They are not caused by this PR. The operator's canonical gate isscripts/check-all.ps1on Windows 11, which haspwshand will exercise those parsers normally.Why one PR, not a new script
Per the Slack directive: no new
.shfiles, nocheck-all.shrewrite — used the existing 986-test gate. Cross-platform pairing ofcheck-all.ps1<->check-all.shis a separate slice tracked by the operator and is not mixed into this security fix.Linked
PyString::from_object)abi3native-subclass type confusion)