Skip to content

Commit ab89123

Browse files
hyperpolymathclaude
andcommitted
feat(v2.5.0): input_boundary (PA024) + mutation gap (PA025)
Add InputBoundary weak point category (PA024): serde_cbor/ciborium/ rmp_serde CBOR+MessagePack calls in Rust; JSON.parse without try/catch in JavaScript; JSON3.read without error handling in Julia. Taint-tracking and A2ML boundary detection deferred to kanren phase. Add MutationGap weak point category (PA025): Rust projects with test modules but no cargo-mutants config; Julia @testset blocks with only type-check assertions (no value diversity); Elixir test files without ExUnitProperties or StreamData. Coverage+mutation-score check deferred — requires runtime coverage data. Completes v2.5.0 Attack Surface Widening milestone. 5 categories added total (PA021–PA025). 25 categories, 49 languages. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent eb949d8 commit ab89123

10 files changed

Lines changed: 309 additions & 14 deletions

File tree

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,41 @@
11
# Changelog
22

3+
## [2.5.0] - 2026-04-12
4+
5+
### Added
6+
- **InputBoundary category (PA024)**: New weak point category detecting unguarded structured-data
7+
parsing at trust boundaries.
8+
- **Rust**: `serde_cbor::from_slice`/`from_reader`, `ciborium::de::from_reader`,
9+
`rmp_serde::from_slice`/`from_read` — CBOR/MessagePack deserialization without a
10+
validation layer (Medium). All five crate patterns flagged.
11+
- **JavaScript/ReScript**: `JSON.parse(` in files without any `try`/`catch` context (High).
12+
Files that do wrap their JSON.parse in try/catch are not flagged.
13+
- **Julia**: `JSON3.read(` and `JSON.parse(` without error handling context (High).
14+
- Taint tracking from external reads to trust-sensitive sinks deferred to kanren phase.
15+
- A2ML boundary detection deferred — requires cross-file analysis.
16+
- **PA024 → panicbot**: InputBoundary mapped to `static-analysis/input-boundary`, 0.72
17+
confidence, Control tier, Partial fixability.
18+
- **MutationGap category (PA025)**: New weak point category detecting mutation and chaos
19+
coverage gaps in test suites.
20+
- **Rust** (project-level): Tests present (`mod tests` / `#[cfg(test)]`) but no
21+
`cargo-mutants` config in `Cargo.toml` or `mutants.toml` — mutation tooling absent (Low).
22+
- **Julia** (per-file): `@testset` blocks where every `@test` is a type-check assertion
23+
(`@test … isa …`) with no value assertions — no assertion diversity (Medium).
24+
- **Elixir** (per-file): Test files using `ExUnit.Case` without importing `ExUnitProperties`
25+
or `StreamData` for property-based testing (Low).
26+
- Coverage-plus-mutation-score check deferred — requires runtime coverage data.
27+
- **PA025 → panicbot**: MutationGap mapped to `static-analysis/mutation-gap`, 0.80
28+
confidence, Substitute tier, Partial fixability.
29+
- **Idris2 ABI completeness**: `PatternCompleteness.idr` updated — InputBoundary (Rust/JS/Julia)
30+
and MutationGap (Rust/Julia/Elixir) added to `WPCategory` with `detectorsFor` entries.
31+
32+
### Changed
33+
- **Category count**: 23 → 25 (added InputBoundary, MutationGap)
34+
- **v2.5.0 milestone**: All tractable items complete. Two deferred items each for
35+
`input_boundary` (taint+A2ML) and `mutation` (coverage-score), and three for
36+
`crypto_misuse` (key-reuse, nonce-reuse, sig-verify) marked as statically undetectable
37+
or requiring runtime data.
38+
339
## [2.3.0] - 2026-04-12
440

541
### Added

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: PMPL-1.0-or-later
22
[package]
33
name = "panic-attack"
4-
version = "2.3.0"
4+
version = "2.5.0"
55
edition = "2021"
66
rust-version = "1.85.0"
77
authors = ["Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>"]

ROADMAP.adoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ stay in sync with their formal counterparts.
103103
Unvalidated deserialization paths at CBOR proof blobs, A2ML manifest parsing,
104104
VeriSimDB scan ingestion (DispatchBridge), and JSON from panic-attack itself.
105105

106-
* [ ] Detect unchecked CBOR / MessagePack deserialization (`serde` without validation)
107-
* [ ] Detect A2ML parsing without `try`/`catch` boundary
108-
* [ ] Detect `JSON.parse` / `JSON3.read` calls not wrapped in error-handling
109-
* [ ] Track taint from external file reads to trust-sensitive sinks (store operations, proof evaluation)
106+
* [x] Detect unchecked CBOR / MessagePack deserialization (`serde_cbor`/`ciborium`/`rmp_serde` in Rust) — PA024
107+
* [ ] Detect A2ML parsing without `try`/`catch` boundary (deferred — requires cross-file taint)
108+
* [x] Detect `JSON.parse` / `JSON3.read` calls not wrapped in error-handling (JS/Julia) — PA024
109+
* [ ] Track taint from external file reads to trust-sensitive sinks (kanren-phase, deferred)
110110

111111
=== `supply_chain` — Dependency and build integrity
112112

@@ -123,10 +123,10 @@ verification, Nix flake input pinning, or Cargo lock coherence checks.
123123

124124
Identified as an estate-wide gap in the 2026-04-05 KRL-stack CRG blitz audit.
125125

126-
* [ ] Detect test suites with zero mutation-test configuration (no `cargo-mutants`, `mutagen`, etc.)
127-
* [ ] Flag `@testset` blocks with no assertion diversity (all `@test x isa Y` style, no value checks)
128-
* [ ] Detect Elixir test suites without `ExUnitProperties` or StreamData for property-based testing
129-
* [ ] Emit `mutation_gap` weak-point for any module with >80% line coverage but zero mutation score
126+
* [x] Detect test suites with zero mutation-test configuration (no `cargo-mutants` in Rust) — PA025
127+
* [x] Flag `@testset` blocks with no assertion diversity (all `@test x isa Y`, no value checks) — PA025
128+
* [x] Detect Elixir test suites without `ExUnitProperties` or StreamData for property-based testing — PA025
129+
* [ ] Emit `mutation_gap` weak-point for any module with >80% line coverage but zero mutation score (requires runtime coverage data — deferred)
130130

131131
== v3.0.0 -- Distributed Scanning
132132

src/abi/PatternCompleteness.idr

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@ crossLangAlwaysApplied : (lang : Lang) -> CrossLangChecked lang
144144
crossLangAlwaysApplied _ = MkCrossLangChecked
145145

146146
-- ═══════════════════════════════════════════════════════════════════════
147-
-- WeakPointCategory enumeration (mirrors src/types.rs, 23 categories)
147+
-- WeakPointCategory enumeration (mirrors src/types.rs, 25 categories)
148148
-- ═══════════════════════════════════════════════════════════════════════
149149

150-
||| All 23 weak point categories detectable by the scanner.
150+
||| All 25 weak point categories detectable by the scanner.
151151
public export
152152
data WPCategory
153153
= UncheckedAllocation
@@ -183,6 +183,15 @@ data WPCategory
183183
||| Manifest.toml without hash entries, flake.nix without narHash,
184184
||| deno.json unpinned specifiers. Detected in Rust, Julia, Nix, JavaScript.
185185
| SupplyChain
186+
||| Structured-data parsing boundary: unchecked CBOR/MessagePack
187+
||| deserialization (serde_cbor, ciborium, rmp_serde in Rust), JSON.parse
188+
||| without try-catch (JavaScript), JSON3.read without error handling (Julia).
189+
| InputBoundary
190+
||| Mutation and chaos coverage gap: test suites with no mutation-test
191+
||| tooling (no cargo-mutants config in Rust), no property-based testing
192+
||| in Elixir (ExUnitProperties/StreamData absent), or Julia @testset blocks
193+
||| with only type-check assertions and no value diversity.
194+
| MutationGap
186195

187196
||| Witness that a detection rule exists for a weak point category.
188197
||| Each variant names the language(s) whose analyzer detects it.
@@ -192,7 +201,7 @@ data HasDetector : WPCategory -> Type where
192201
DetectedBy : (langs : List Lang) -> HasDetector cat
193202

194203
||| Every weak point category has at least one detector.
195-
||| Total: Idris2 verifies all 23 constructors are covered.
204+
||| Total: Idris2 verifies all 25 constructors are covered.
196205
||| The list of detecting languages mirrors the actual pattern
197206
||| matching code in analyzer.rs.
198207
public export
@@ -220,6 +229,8 @@ detectorsFor UnsafeTypeCoercion = DetectedBy [OCaml, Haskell, DLang, Nim]
220229
detectorsFor ProofDrift = DetectedBy [Idris, Lean, Agda, Isabelle, Coq, Julia]
221230
detectorsFor CryptoMisuse = DetectedBy [Rust, Python, JavaScript, Go, Elixir]
222231
detectorsFor SupplyChain = DetectedBy [Rust, Julia, Nix, JavaScript]
232+
detectorsFor InputBoundary = DetectedBy [Rust, JavaScript, Julia]
233+
detectorsFor MutationGap = DetectedBy [Rust, Julia, Elixir]
223234

224235
||| Proof: every weak point category has at least one detector.
225236
public export

0 commit comments

Comments
 (0)