@clear-capabilities/agentic-security-scanner 0.151.3 → 0.152.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/dist/agentic-security.mjs +80 -80
  3. package/dist/agentic-security.mjs.sha256 +1 -1
  4. package/package.json +5 -5
  5. package/src/dataflow/CLAUDE.md +1 -1
  6. package/src/dataflow/catalog.js +802 -13
  7. package/src/dataflow/engine.js +852 -89
  8. package/src/dataflow/incremental.js +13 -0
  9. package/src/dataflow/index.js +18 -5
  10. package/src/dataflow/path-feasibility.js +86 -9
  11. package/src/dataflow/string-domain.js +132 -0
  12. package/src/dataflow/summaries.js +69 -8
  13. package/src/engine.js +108 -3
  14. package/src/ir/CLAUDE.md +2 -1
  15. package/src/ir/balanced-call.js +33 -1
  16. package/src/ir/callgraph.js +26 -2
  17. package/src/ir/class-hierarchy.js +101 -6
  18. package/src/ir/csharp-ir.js +97 -8
  19. package/src/ir/index.js +21 -1
  20. package/src/ir/parser-cs.js +706 -24
  21. package/src/ir/parser-java.js +498 -17
  22. package/src/ir/parser-js.js +22 -0
  23. package/src/ir/parser-php.js +446 -43
  24. package/src/ir/parser-rust.js +1338 -0
  25. package/src/ir/php-include-merge.js +190 -0
  26. package/src/lineage/sink-registry.js +18 -0
  27. package/src/lineage/source-registry.js +23 -0
  28. package/src/posture/csharp-analysis.js +341 -43
  29. package/src/posture/finding-defaults.js +5 -1
  30. package/src/posture/fix-coverage.js +1 -0
  31. package/src/posture/proof-coverage.js +1 -0
  32. package/src/sast/CLAUDE.md +1 -1
  33. package/src/sast/authz.js +144 -1
  34. package/src/sast/crypto-protocol.js +65 -7
  35. package/src/sast/csharp-cross-file.js +125 -0
  36. package/src/sast/csharp-structural.js +78 -2
  37. package/src/sast/csharp.js +574 -42
  38. package/src/sast/java-ast-folding.js +268 -11
  39. package/src/sast/java-bench-extras.js +530 -2
  40. package/src/sast/java-deserialization.js +31 -2
  41. package/src/sast/java-structural-cross-file.js +146 -0
  42. package/src/sast/java-structural.js +499 -6
  43. package/src/sast/ldap-injection.js +133 -3
  44. package/src/sast/rust.js +57 -0
  45. package/src/sast/xss-reflected-multilang.js +252 -3
package/CHANGELOG.md CHANGED
@@ -9,6 +9,77 @@
9
9
  > make the history less accurate, not more.
10
10
 
11
11
 
12
+ ## 0.152.0 - Rust: first-class language, and the SARD 80% F1 push's taint-engine architecture work
13
+
14
+ Rust joins the first-class language set (JS/TS, Python, Java, Kotlin, Go, Ruby, PHP, C#) with both
15
+ a hand-rolled IR frontend (`scanner/src/ir/parser-rust.js`, the `parser-go.js`/`parser-cs.js`
16
+ pattern) feeding the Layer-2 taint engine, and dedicated SAST rules — Rust previously had only the
17
+ opt-in, WASM-based tree-sitter long-tail path, which nothing in the taint engine ever consumed.
18
+
19
+ - **Taint coverage** (`dataflow/catalog.js`, ~90 new source/sink/sanitizer entries): SQL injection
20
+ (sqlx/diesel/rusqlite/postgres, distinguishing the compile-checked `query!` macro and `.bind()`
21
+ parameterization from `format!`-built SQL text), command injection (`Command::new("sh").arg("-c")`
22
+ vs. safe argv-array execution), path traversal (`std::fs`/`tokio::fs`, recognizing a
23
+ canonicalize+`starts_with` containment guard), SSRF (reqwest/ureq), reflected XSS
24
+ (actix/axum/rocket/warp response bodies), open redirect, log injection, insecure deserialization,
25
+ and uncontrolled resource consumption. Sources include axum/actix/rocket extractor-typed
26
+ parameters (`Query`/`Path`/`Json`/`Form`/`HeaderMap`) via a new `paramAnnotations` side-channel
27
+ and route-attributed handlers (`#[get("/<x>")]`).
28
+ - **SAST rules** (`sast/rust.js`): TLS verification disabled, weak hash/cipher (MD5/SHA-1/DES/RC4),
29
+ weak randomness feeding a token/secret identifier, and unsafe raw-memory operations
30
+ (`transmute`/`from_raw_parts`/`get_unchecked`) — alongside the pre-existing sqlx-format/shell-form
31
+ command-injection/zero-seed-RNG/unsafe-block regex rules.
32
+ - **A real parser design lesson, not specific to Rust's own correctness**: `.unwrap()`/`.expect(msg)`
33
+ chained onto a sink call shift the chain's terminal segment away from the sink's own name (the same
34
+ "terminal segment shift" defect class already documented for Go/Java/Kotlin) — nearly every
35
+ real-world async Rust call site ends this way, so they are popped from the parsed call chain
36
+ rather than merely treated as taint-transparent.
37
+ - **Measured**: `bench/layer-recall` — 5/5 (100%) whole-corpus, 3/3 (100%) deep-tier on first
38
+ measurement (see `docs/METRICS.md`; the corpus is small today, so this reflects the corpus's own
39
+ composition, not general ecosystem coverage). `bench/cve-replay` — 5 new entries (2 capability,
40
+ 3 deep), all `pre:TP post:TN`. `bench/mutation` — 1 new detection-dimension baseline/adversarial
41
+ pair (`format!`-built SQL fires; the parameterized `.bind()` form does not).
42
+
43
+ ### SARD/Juliet 80% macro-F1 push (`bench/sard/EXECUTION_STATUS.md`) — substantial progress, DoD not yet met
44
+
45
+ A long-running execution PRD targeting macro-F1 >= 80% on the held-out TEST split for Java, C#, and
46
+ PHP against the SARD/Juliet benchmark corpus. **Honest status: real, verified, substantial gains for
47
+ all three languages, but the 80% target is not yet reached** — Java macroF1=59.1%, C#
48
+ macroF1=68.6% (clears the 50% M2 gate), PHP macroF1=48.2% (all measured on TEST split, never on
49
+ gold/answer-key signals — see the PRD's own integrity rules). This release ships the engine and
50
+ scoring work; the PRD stays open.
51
+
52
+ - **Measurement integrity first**: fixed truncation-masking in the benchmark harness (a truncated
53
+ scan was silently scoring as if complete), added per-CWE batched scanning to eliminate it in
54
+ practice, and made the scan surface match the gold surface exactly.
55
+ - **Structural class resolution**: real `ir.classes` emission and class-hierarchy-based method
56
+ resolution replacing regex heuristics, across the languages that lacked it.
57
+ - **Interprocedural completeness**: cross-file field/chain taint for C# (`csharp-cross-file.js`) and
58
+ Java, collection-element taint (typed reads, for-each binding), abstract/interface dispatch via
59
+ declared base type, and real branch+join CFGs for Java `if`/`switch` (previously linear
60
+ fall-through — a real correctness bug, not just a recall gap).
61
+ - **Precision**: guard-predicate narrowing (`is_numeric`/`ctype_digit`/`int.TryParse`/etc. on an
62
+ if-statement's TRUE branch only), a proven-clean ledger, and dozens of per-CWE false-positive
63
+ fixes across Java/C# (many rooted in Juliet's own "dead code by construction" idioms —
64
+ `if(true)`/`if(5==5)`/constant-folded fields/methods — defeating naive literal-tracking heuristics).
65
+ - **Call-string context-sensitivity, built from scratch this push**: `dataflow/engine.js` now
66
+ narrows a shared static/class field's taint to only the callers that can actually reach it
67
+ (previously any writer anywhere in the class tainted every reader), closing a real
68
+ context-sensitivity gap independently identified across all three languages. A second,
69
+ previously-built-but-never-validated k=1 call-string mechanism (`AGENTIC_SECURITY_KCFA_CALLSTRING`,
70
+ opt-in) was found broken, root-caused, and repaired.
71
+ - **Two new "next-generation taint analysis" capabilities**, requested and scoped independently of
72
+ the SARD benchmark itself: (1) sound regex-validation-guard narrowing for JS/TS — a
73
+ fully-anchored pattern like `/^[a-zA-Z0-9]+$/` used as `if (pattern.test(x))` now provably proves
74
+ `x` metacharacter-free on the true branch, via a new conservative character-class parser
75
+ (`dataflow/string-domain.js`'s `isSafeValidationPattern`); (2) object-instance field taint via
76
+ method calls, a general (not JS-specific) engine capability — `bad.setData(tainted)` now taints
77
+ `bad`'s own field, read back correctly through `bad.getData()`, while a **different** instance of
78
+ the same class stays untainted (real object-instance sensitivity, without a full
79
+ allocation-site-keyed heap model).
80
+ - PHP: closed total blackouts for LFI/RFI (`include`/`require` result assignment), several IDOR
81
+ sub-shapes, and a cross-file variable-scope-merging capability for split include chains.
82
+
12
83
  ## 0.151.3 - Adversarial premortem on the SARD benchmarking PROGRAM itself: full remediation, first genuine held-out numbers
13
84
 
14
85
  A structured adversarial premortem ("assume this has completely failed six months from now — work