Skip to content

Commit 8667f1f

Browse files
authored
fix(security): imageproc 0.26, NaN panic hardening, audit.toml cleanup (#505)
Build on the existing security audit branch with additional hardening: - **RUSTSEC-2026-0115/0116/0117**: Bump `imageproc 0.25` → `0.26.2` in `examples/scipix/Cargo.toml`. All three soundness notices (improper bounds checks and fragile sampling code) are fixed in 0.26.x. Remove the now-stale ignore entries from `.cargo/audit.toml`. Replace remaining bare `.partial_cmp(...).unwrap()` — which panics when NaN appears in the slice — with `.total_cmp(...)` (stable since Rust 1.62, NaN-total, no panic) in production source files: - `crates/ruvllm/src/claude_flow/agent_router.rs` (score max/sort) - `crates/ruvllm/src/claude_flow/task_classifier.rs` (score sort) - `crates/ruvllm/src/evaluation/economics.rs` (percentile sort) - `crates/ruvllm/src/metal/operations.rs` (argmax over logits) - `crates/ruvllm/src/qat/calibration.rs` (percentile sort) - `crates/ruvllm/src/training/grpo.rs` (reward/advantage max) - `crates/ruvector-postgres/src/healing/strategies.rs` (strategy weight max) - `crates/ruvector-postgres/src/learning/patterns.rs` (k-means++ distance) - `crates/ruvector-postgres/src/learning/reasoning_bank.rs` (similarity sort) - `crates/ruvector-postgres/src/math/operators.rs` (Wasserstein sort) - `crates/ruvector-postgres/src/quantization/binary.rs` (rerank sort) - `crates/ruvector-postgres/src/sparse/types.rs` (top-k sparse abs sort) - `crates/ruvector-solver/src/forward_push.rs` (argmax in test)
1 parent b04ea1f commit 8667f1f

16 files changed

Lines changed: 739 additions & 939 deletions

File tree

.cargo/audit.toml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# cargo-audit configuration for the ruvector workspace.
2+
#
3+
# Ignored advisories MUST have a justification. Anything fixable should be
4+
# fixed via a dependency bump rather than ignored here. Re-evaluate the
5+
# `until` dates periodically.
6+
7+
[advisories]
8+
ignore = [
9+
# ------------------------------------------------------------------
10+
# Vulnerabilities (genuinely no upstream fix available)
11+
# ------------------------------------------------------------------
12+
13+
# rsa 0.9.x — Marvin Attack (timing sidechannel on RSA decryption).
14+
# No fixed upgrade is available from upstream `rsa`. We do not expose
15+
# an RSA decryption oracle: TLS in this workspace runs on rustls with
16+
# Ed25519/X25519 suites, and `rsa` is pulled only transitively (e.g.
17+
# SQL drivers, JWT verification paths) where we never decrypt
18+
# attacker-controlled ciphertexts under a long-lived RSA key.
19+
# Re-evaluate when the `rsa` crate ships a constant-time implementation.
20+
"RUSTSEC-2023-0071",
21+
22+
# ------------------------------------------------------------------
23+
# "Unmaintained" warnings (informational, not vulnerabilities)
24+
# ------------------------------------------------------------------
25+
# These are pulled transitively through deps we do not control. They
26+
# are not exploitable on their own; they are notices that the upstream
27+
# crate is no longer accepting patches. We mute them to keep CI clean
28+
# and revisit when the parent dep migrates.
29+
30+
"RUSTSEC-2021-0140", # rusttype — transitive via plotters; pure rendering, no untrusted input
31+
"RUSTSEC-2022-0054", # wee_alloc — transitive via wasm-bindgen-cli internals
32+
"RUSTSEC-2024-0370", # proc-macro-error — build-time only (proc-macro), no runtime exposure
33+
"RUSTSEC-2024-0380", # pqcrypto-dilithium — replaced by pqcrypto-mldsa, awaiting parent migration
34+
"RUSTSEC-2024-0381", # pqcrypto-kyber — replaced by pqcrypto-mlkem, awaiting parent migration
35+
"RUSTSEC-2024-0384", # instant — transitive via parking_lot/older time deps
36+
"RUSTSEC-2024-0388", # derivative — transitive proc-macro
37+
"RUSTSEC-2024-0436", # paste — transitive proc-macro, build-time only
38+
"RUSTSEC-2025-0119", # number_prefix — transitive via indicatif rendering
39+
"RUSTSEC-2025-0124", # rand_os — transitive, replaced by getrandom in modern code paths
40+
"RUSTSEC-2025-0134", # rustls-pemfile — transitive; rustls itself is current
41+
"RUSTSEC-2025-0141", # bincode — unmaintained notice; we pin a known-good version
42+
"RUSTSEC-2026-0105", # core2 — transitive, no_std fallback for std::io types
43+
44+
# ------------------------------------------------------------------
45+
# Soundness/unsoundness notices in deps we do not directly control
46+
# ------------------------------------------------------------------
47+
48+
# lru — IterMut Stacked Borrows violation. Used transitively; we do
49+
# not call IterMut from the affected crate. Track parent dep upgrade.
50+
"RUSTSEC-2024-0408",
51+
52+
# pprof — unsound `slice::from_raw_parts` usage. Only loaded behind
53+
# benchmark/profiling features, never in production binaries.
54+
"RUSTSEC-2026-0002",
55+
56+
# rand — unsoundness when using a custom global logger with rand::rng().
57+
# We never install a custom logger in the rand call path. Awaiting
58+
# transitive upgrade across the workspace.
59+
"RUSTSEC-2026-0097",
60+
61+
# imageproc 0.25.0 advisories — RESOLVED: bumped to imageproc 0.26.2.
62+
# Keeping the IDs commented out for historical reference; remove this
63+
# block on next audit.toml cleanup.
64+
# "RUSTSEC-2026-0115", # fixed in 0.26+
65+
# "RUSTSEC-2026-0116", # fixed in 0.26+
66+
# "RUSTSEC-2026-0117", # fixed in 0.26+
67+
]

0 commit comments

Comments
 (0)