Commit 4241abf
fix(provers): bounded_read_proof_file helper + 25 wrapper migrations
Closes 25 of the 26 panic-attack UnboundedAllocation findings flagged
in reports/panic-attack-chunks/src-rust.json (deferred follow-up from
2026-04-25 evening session).
Adds src/rust/provers/io.rs with `bounded_read_proof_file` capping
proof-file reads at 64 MiB via `AsyncReadExt::take(N+1)` (TOCTOU-safe,
errors on overflow rather than truncating). Migrates 25 prover
backends from bare `tokio::fs::read_to_string(&path)` to the bounded
helper:
abella, acl2s, arend, athena, boogie, cameleer, cubical_agda,
dedukti, hp_ecosystem, isabelle_zf, lambda_prolog, lean3, matita,
mercury, mizar_ar, naproche, nitpick, nunchaku, opensmt, prover9,
rocq, smtrat, typed_wasm, uppaal_stratego, zipperposition
The 26th finding (integrity/solver_integrity.rs) is a TOML manifest
read at startup from an operator-controlled path — different threat
shape, deferred to a follow-up.
The 47 unflagged backends already pass the panic-attack heuristic
(detector treats `read_to_string` as bounded if the file's source
contains the word "limit"); migrating them now would be scope creep
beyond closing the surfaced findings. Future estate-wide pass can
fold them in.
io.rs ships with two unit tests (small_file_reads_fully,
oversized_file_errors) — both pass under cargo test --lib.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 87f49a4 commit 4241abf
28 files changed
Lines changed: 141 additions & 33 deletions
File tree
- src/rust/provers
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| |||
0 commit comments