Skip to content

Commit e3bbf42

Browse files
fix(security): bound load_octads_jsonl read — panic-attack Critical resurfaced (Refs #104) (#176)
## Summary The 2026-06-01 panic-attack assail re-run surfaced one **Critical UnboundedAllocation** at `src/rust/corpus/octad.rs:483`. PR #145 closed 7 of 8 Critical findings via `bounded_read_corpus_file` (Refs #104). This 8th call site, `Corpus::load_octads_jsonl`, was added to the codebase after that sweep and re-introduces the same `std::fs::read_to_string(path)` pattern that #145 fixed everywhere else. ## Fix One-line route through the existing helper: ```rust // before let raw = std::fs::read_to_string(path) .with_context(|| format!("read {}", path.display()))?; // after let raw = crate::provers::bounded_read_corpus_file(path)?; ``` Identical pattern to #145 — 64 MiB cap via `MAX_PROOF_BYTES`, `Read::take(N+1)` discipline, error-not-truncate semantics. Unit tests already cover the helper (`src/rust/provers/io.rs` lines 107-123). ## Test plan - [x] `cargo check --lib` (helper visibility — already `pub use`d in `src/rust/provers/mod.rs:20`) - [ ] `cargo test --lib corpus::octad` (CI) - [ ] panic-attack re-run after merge — Critical count should drop from 1 to 0 ## Out of scope - The other 12 High UnsafeCode/UnsafeFFI findings from the 2026-06-01 re-run will be filed as a tracker issue for human triage (matches the #104 pattern); most are post-#104 FFI additions (`coprocessor/flint.rs`, `src/zig_ffi/chapel_bridge.zig`, `src/zig/ffi/axiom_spark_bridge.zig`, `ffi/zig/src/*.zig`) that should land in `reports/audits/assail-classifications.a2ml` rather than be code-fixed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 408b7aa commit e3bbf42

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/rust/corpus/octad.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,9 @@ impl Corpus {
479479
pub fn load_octads_jsonl(path: &Path) -> Result<Self> {
480480
use std::collections::HashMap as Map;
481481

482-
let raw =
483-
std::fs::read_to_string(path).with_context(|| format!("read {}", path.display()))?;
482+
// Bounded read (64 MiB cap via MAX_PROOF_BYTES) — mirrors the
483+
// remediation pattern from #145 (Refs #104).
484+
let raw = crate::provers::bounded_read_corpus_file(path)?;
484485

485486
let mut corpus = Corpus::default();
486487
let mut adapter_set: Option<String> = None;

0 commit comments

Comments
 (0)