@clear-capabilities/agentic-security-scanner 0.74.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 (331) hide show
  1. package/CHANGELOG.md +1580 -0
  2. package/bin/.agentic-security/findings.json +1577 -0
  3. package/bin/.agentic-security/last-scan.json +1577 -0
  4. package/bin/.agentic-security/last-scan.json.sig +1 -0
  5. package/bin/.agentic-security/scan-history.json +465 -0
  6. package/bin/.agentic-security/streak.json +25 -0
  7. package/bin/agentic-security-audit.js +198 -0
  8. package/bin/agentic-security-consistency.js +80 -0
  9. package/bin/agentic-security-diff.js +136 -0
  10. package/bin/agentic-security-lsp.js +12 -0
  11. package/bin/agentic-security-mcp.js +40 -0
  12. package/bin/agentic-security-rule.js +153 -0
  13. package/bin/agentic-security.js +1683 -0
  14. package/dist/117.index.js +207 -0
  15. package/dist/178.index.js +250 -0
  16. package/dist/218.index.js +793 -0
  17. package/dist/227.index.js +192 -0
  18. package/dist/301.index.js +167 -0
  19. package/dist/384.index.js +18 -0
  20. package/dist/476.index.js +126 -0
  21. package/dist/513.index.js +373 -0
  22. package/dist/520.index.js +13 -0
  23. package/dist/601.index.js +1038 -0
  24. package/dist/634.index.js +1892 -0
  25. package/dist/637.index.js +216 -0
  26. package/dist/660.index.js +131 -0
  27. package/dist/675.index.js +451 -0
  28. package/dist/826.index.js +188 -0
  29. package/dist/830.index.js +133 -0
  30. package/dist/agentic-security.mjs +272 -0
  31. package/dist/agentic-security.mjs.sha256 +1 -0
  32. package/dist/calibration-seed.json +27 -0
  33. package/package.json +77 -0
  34. package/src/.agentic-security/findings.json +80844 -0
  35. package/src/.agentic-security/last-scan.json +80844 -0
  36. package/src/.agentic-security/last-scan.json.sig +1 -0
  37. package/src/.agentic-security/scan-history.json +8408 -0
  38. package/src/.agentic-security/streak.json +26 -0
  39. package/src/badge.js +188 -0
  40. package/src/compare.js +203 -0
  41. package/src/dataflow/.agentic-security/findings.json +3487 -0
  42. package/src/dataflow/.agentic-security/last-scan.json +3487 -0
  43. package/src/dataflow/.agentic-security/last-scan.json.sig +1 -0
  44. package/src/dataflow/.agentic-security/scan-history.json +735 -0
  45. package/src/dataflow/.agentic-security/streak.json +24 -0
  46. package/src/dataflow/CLAUDE.md +38 -0
  47. package/src/dataflow/access-paths.js +172 -0
  48. package/src/dataflow/async-sequencing.js +177 -0
  49. package/src/dataflow/backward.js +201 -0
  50. package/src/dataflow/catalog-expanded.js +485 -0
  51. package/src/dataflow/catalog.js +659 -0
  52. package/src/dataflow/cross-repo.js +219 -0
  53. package/src/dataflow/engine.js +588 -0
  54. package/src/dataflow/exception-flow.js +116 -0
  55. package/src/dataflow/exploit-prover.js +187 -0
  56. package/src/dataflow/higher-order.js +221 -0
  57. package/src/dataflow/ifds.js +347 -0
  58. package/src/dataflow/implicit-flow.js +129 -0
  59. package/src/dataflow/incremental.js +229 -0
  60. package/src/dataflow/index.js +181 -0
  61. package/src/dataflow/numeric-domain.js +192 -0
  62. package/src/dataflow/path-feasibility.js +114 -0
  63. package/src/dataflow/points-to.js +337 -0
  64. package/src/dataflow/polyglot.js +190 -0
  65. package/src/dataflow/proven-clean.js +159 -0
  66. package/src/dataflow/receiver-context.js +76 -0
  67. package/src/dataflow/sanitizer-proof.js +154 -0
  68. package/src/dataflow/soft-taint.js +140 -0
  69. package/src/dataflow/string-domain.js +234 -0
  70. package/src/dataflow/stub-aware-filter.js +100 -0
  71. package/src/dataflow/summaries.js +132 -0
  72. package/src/dataflow/symbolic-exec.js +238 -0
  73. package/src/dataflow/tabulation.js +135 -0
  74. package/src/engine.js +7763 -0
  75. package/src/history-scan.js +229 -0
  76. package/src/index.js +3 -0
  77. package/src/integrations/.agentic-security/findings.json +1504 -0
  78. package/src/integrations/.agentic-security/last-scan.json +1504 -0
  79. package/src/integrations/.agentic-security/scan-history.json +40 -0
  80. package/src/integrations/.agentic-security/streak.json +21 -0
  81. package/src/integrations/index.js +321 -0
  82. package/src/integrations/tickets.js +200 -0
  83. package/src/ir/.agentic-security/findings.json +3036 -0
  84. package/src/ir/.agentic-security/last-scan.json +3036 -0
  85. package/src/ir/.agentic-security/last-scan.json.sig +1 -0
  86. package/src/ir/.agentic-security/scan-history.json +364 -0
  87. package/src/ir/.agentic-security/streak.json +23 -0
  88. package/src/ir/CLAUDE.md +172 -0
  89. package/src/ir/callgraph.js +73 -0
  90. package/src/ir/class-hierarchy.js +195 -0
  91. package/src/ir/index.js +152 -0
  92. package/src/ir/parser-cs.js +260 -0
  93. package/src/ir/parser-java.js +286 -0
  94. package/src/ir/parser-js.js +413 -0
  95. package/src/ir/parser-kt.js +258 -0
  96. package/src/ir/parser-py-cst.js +136 -0
  97. package/src/ir/parser-py.helper.py +501 -0
  98. package/src/ir/parser-py.js +312 -0
  99. package/src/ir/ssa.js +315 -0
  100. package/src/ir/type-stubs.js +288 -0
  101. package/src/leaderboard.js +152 -0
  102. package/src/llm-validator/.agentic-security/findings.json +1891 -0
  103. package/src/llm-validator/.agentic-security/last-scan.json +1891 -0
  104. package/src/llm-validator/.agentic-security/last-scan.json.sig +1 -0
  105. package/src/llm-validator/.agentic-security/scan-history.json +168 -0
  106. package/src/llm-validator/.agentic-security/streak.json +20 -0
  107. package/src/llm-validator/consistency.js +141 -0
  108. package/src/llm-validator/index.js +437 -0
  109. package/src/lsp/.agentic-security/findings.json +28 -0
  110. package/src/lsp/.agentic-security/last-scan.json +28 -0
  111. package/src/lsp/.agentic-security/scan-history.json +79 -0
  112. package/src/lsp/.agentic-security/streak.json +22 -0
  113. package/src/lsp/server.js +275 -0
  114. package/src/mcp/.agentic-security/findings.json +8358 -0
  115. package/src/mcp/.agentic-security/last-scan.json +8358 -0
  116. package/src/mcp/.agentic-security/last-scan.json.sig +1 -0
  117. package/src/mcp/.agentic-security/scan-history.json +1125 -0
  118. package/src/mcp/.agentic-security/streak.json +22 -0
  119. package/src/mcp/CLAUDE.md +54 -0
  120. package/src/mcp/audit.js +136 -0
  121. package/src/mcp/redact.js +75 -0
  122. package/src/mcp/server.js +158 -0
  123. package/src/mcp/stdio.js +83 -0
  124. package/src/mcp/tools.js +940 -0
  125. package/src/mcp/validate.js +49 -0
  126. package/src/personality.js +164 -0
  127. package/src/poc-video.js +239 -0
  128. package/src/posture/.agentic-security/findings.json +51239 -0
  129. package/src/posture/.agentic-security/last-scan.json +51239 -0
  130. package/src/posture/.agentic-security/last-scan.json.sig +1 -0
  131. package/src/posture/.agentic-security/scan-history.json +5557 -0
  132. package/src/posture/.agentic-security/streak.json +24 -0
  133. package/src/posture/CLAUDE.md +42 -0
  134. package/src/posture/adversarial-self-test.js +114 -0
  135. package/src/posture/adversary-agent.js +204 -0
  136. package/src/posture/agents-memory.js +135 -0
  137. package/src/posture/ai-code-fingerprint.js +171 -0
  138. package/src/posture/aibom.js +284 -0
  139. package/src/posture/api-inventory.js +96 -0
  140. package/src/posture/attack-playbooks.js +305 -0
  141. package/src/posture/auditor-agent.js +115 -0
  142. package/src/posture/auth-posture-import.js +135 -0
  143. package/src/posture/baseline-compare.js +114 -0
  144. package/src/posture/blast-radius.js +836 -0
  145. package/src/posture/bounty-prediction.js +141 -0
  146. package/src/posture/business-logic.js +239 -0
  147. package/src/posture/calibration-drift.js +93 -0
  148. package/src/posture/calibration-seed.json +27 -0
  149. package/src/posture/calibration.js +204 -0
  150. package/src/posture/clustering.js +75 -0
  151. package/src/posture/concurrency-checker.js +265 -0
  152. package/src/posture/confidence.js +65 -0
  153. package/src/posture/container-runtime.js +149 -0
  154. package/src/posture/counterfactual.js +109 -0
  155. package/src/posture/cross-lang-graphql.js +165 -0
  156. package/src/posture/cross-lang-grpc.js +166 -0
  157. package/src/posture/cross-lang-meta.js +101 -0
  158. package/src/posture/cross-lang-openapi.js +187 -0
  159. package/src/posture/cross-lang-orm.js +153 -0
  160. package/src/posture/cross-lang-queues.js +210 -0
  161. package/src/posture/crown-jewels.js +110 -0
  162. package/src/posture/custom-rules.js +361 -0
  163. package/src/posture/cve-alert-daemon.js +433 -0
  164. package/src/posture/cve-lookup.js +129 -0
  165. package/src/posture/dead-code.js +430 -0
  166. package/src/posture/defender-agent.js +158 -0
  167. package/src/posture/deploy-platform.js +204 -0
  168. package/src/posture/detector-fuzz.js +61 -0
  169. package/src/posture/deterministic.js +99 -0
  170. package/src/posture/drift.js +165 -0
  171. package/src/posture/epss.js +156 -0
  172. package/src/posture/exploitability-probability.js +212 -0
  173. package/src/posture/exploitability.js +121 -0
  174. package/src/posture/feature-flags.js +110 -0
  175. package/src/posture/finding-defaults.js +132 -0
  176. package/src/posture/fix-history.js +411 -0
  177. package/src/posture/fix-plan.js +121 -0
  178. package/src/posture/fix-verify-loop.js +157 -0
  179. package/src/posture/fix-verify.js +130 -0
  180. package/src/posture/flow-narration.js +105 -0
  181. package/src/posture/grader-calibration.js +156 -0
  182. package/src/posture/harness-discovery.js +113 -0
  183. package/src/posture/holdout-eval.js +144 -0
  184. package/src/posture/iac-reachability.js +163 -0
  185. package/src/posture/iam-policy.js +128 -0
  186. package/src/posture/integrity.js +97 -0
  187. package/src/posture/learning.js +166 -0
  188. package/src/posture/license-policy.js +109 -0
  189. package/src/posture/llm-redteam-prompts.js +418 -0
  190. package/src/posture/llm-redteam.js +303 -0
  191. package/src/posture/material-change.js +163 -0
  192. package/src/posture/mitigation-composite.js +55 -0
  193. package/src/posture/mttr.js +91 -0
  194. package/src/posture/network-policy-import.js +126 -0
  195. package/src/posture/path-predicates.js +99 -0
  196. package/src/posture/persona-prioritization.js +153 -0
  197. package/src/posture/poc-cwe-map.js +51 -0
  198. package/src/posture/poc-generator.js +500 -0
  199. package/src/posture/policy-gate.js +174 -0
  200. package/src/posture/pre-incident-archaeology.js +110 -0
  201. package/src/posture/profile.js +93 -0
  202. package/src/posture/reachability-filter.js +42 -0
  203. package/src/posture/regression-test-gen.js +200 -0
  204. package/src/posture/reverse-blast-radius.js +110 -0
  205. package/src/posture/router.js +109 -0
  206. package/src/posture/rule-overrides.js +198 -0
  207. package/src/posture/rule-pack-signing.js +209 -0
  208. package/src/posture/rule-packs.js +143 -0
  209. package/src/posture/rule-synthesis.js +108 -0
  210. package/src/posture/ruleset-version.js +71 -0
  211. package/src/posture/sbom.js +129 -0
  212. package/src/posture/schema-aware-bridge.js +207 -0
  213. package/src/posture/security-trend.js +87 -0
  214. package/src/posture/semantic-clone.js +114 -0
  215. package/src/posture/specification-mining.js +170 -0
  216. package/src/posture/stable-id.js +75 -0
  217. package/src/posture/stack-playbook.js +229 -0
  218. package/src/posture/streak.js +249 -0
  219. package/src/posture/suppressions.js +135 -0
  220. package/src/posture/telemetry-ingest.js +112 -0
  221. package/src/posture/threat-model.js +145 -0
  222. package/src/posture/three-agent-pipeline.js +74 -0
  223. package/src/posture/triage.js +146 -0
  224. package/src/posture/trust-boundary-diagram.js +115 -0
  225. package/src/posture/type-narrowing.js +129 -0
  226. package/src/posture/validator-metrics.js +179 -0
  227. package/src/posture/verifier-ephemeral.js +118 -0
  228. package/src/posture/verifier-target.js +147 -0
  229. package/src/posture/verifier.js +257 -0
  230. package/src/posture/version.js +75 -0
  231. package/src/posture/waf-ingest.js +200 -0
  232. package/src/posture/why-fired.js +141 -0
  233. package/src/pr-comment.js +172 -0
  234. package/src/pr-delta.js +198 -0
  235. package/src/report/.agentic-security/findings.json +79 -0
  236. package/src/report/.agentic-security/last-scan.json +79 -0
  237. package/src/report/.agentic-security/last-scan.json.sig +1 -0
  238. package/src/report/.agentic-security/scan-history.json +332 -0
  239. package/src/report/.agentic-security/streak.json +23 -0
  240. package/src/report/index.js +1136 -0
  241. package/src/report/mascot.js +42 -0
  242. package/src/runScan.js +141 -0
  243. package/src/sast/.agentic-security/findings.json +5051 -0
  244. package/src/sast/.agentic-security/last-scan.json +5051 -0
  245. package/src/sast/.agentic-security/last-scan.json.sig +1 -0
  246. package/src/sast/.agentic-security/scan-history.json +788 -0
  247. package/src/sast/.agentic-security/streak.json +23 -0
  248. package/src/sast/CLAUDE.md +39 -0
  249. package/src/sast/_comment-strip.js +46 -0
  250. package/src/sast/agent-tool-escalation.js +131 -0
  251. package/src/sast/auth-provider.js +171 -0
  252. package/src/sast/authz.js +236 -0
  253. package/src/sast/bench-shape/.agentic-security/findings.json +28 -0
  254. package/src/sast/bench-shape/.agentic-security/last-scan.json +28 -0
  255. package/src/sast/bench-shape/.agentic-security/scan-history.json +24 -0
  256. package/src/sast/bench-shape/.agentic-security/streak.json +22 -0
  257. package/src/sast/bench-shape/index.js +62 -0
  258. package/src/sast/claude-hook-injection.js +199 -0
  259. package/src/sast/claude-md-prompt-injection.js +170 -0
  260. package/src/sast/claude-settings.js +165 -0
  261. package/src/sast/client-side.js +149 -0
  262. package/src/sast/cpp-bench-extras.js +122 -0
  263. package/src/sast/cpp-dataflow.js +430 -0
  264. package/src/sast/cpp.js +248 -0
  265. package/src/sast/csharp.js +152 -0
  266. package/src/sast/csrf.js +82 -0
  267. package/src/sast/dart-flutter.js +173 -0
  268. package/src/sast/db-rls.js +147 -0
  269. package/src/sast/db-taint.js +215 -0
  270. package/src/sast/defi-deep.js +242 -0
  271. package/src/sast/deserialization-gadgets.js +113 -0
  272. package/src/sast/django-hardening.js +230 -0
  273. package/src/sast/env-hygiene.js +125 -0
  274. package/src/sast/fastapi-hardening.js +145 -0
  275. package/src/sast/go-extended.js +84 -0
  276. package/src/sast/host-header.js +106 -0
  277. package/src/sast/index.js +17 -0
  278. package/src/sast/java-ast-folding.js +561 -0
  279. package/src/sast/java-bench-extras.js +708 -0
  280. package/src/sast/java-collection-passthrough.js +178 -0
  281. package/src/sast/java-constant-fold.js +244 -0
  282. package/src/sast/java-deserialization.js +125 -0
  283. package/src/sast/jndi.js +104 -0
  284. package/src/sast/juliet-shape.js +324 -0
  285. package/src/sast/jwt-exp.js +104 -0
  286. package/src/sast/kotlin.js +82 -0
  287. package/src/sast/laravel-hardening.js +198 -0
  288. package/src/sast/ldap-injection.js +100 -0
  289. package/src/sast/llm-owasp.js +465 -0
  290. package/src/sast/llm-stored-prompt.js +103 -0
  291. package/src/sast/llm-trading-agent.js +161 -0
  292. package/src/sast/llm.js +308 -0
  293. package/src/sast/logic.js +140 -0
  294. package/src/sast/mass-assignment.js +101 -0
  295. package/src/sast/mcp-audit.js +242 -0
  296. package/src/sast/mobile-manifest.js +195 -0
  297. package/src/sast/model-load.js +164 -0
  298. package/src/sast/mutation-xss.js +87 -0
  299. package/src/sast/nosql-injection.js +82 -0
  300. package/src/sast/open-redirect.js +119 -0
  301. package/src/sast/php.js +91 -0
  302. package/src/sast/pipeline.js +122 -0
  303. package/src/sast/primary-cwe-java.js +155 -0
  304. package/src/sast/prompt-firewall.js +151 -0
  305. package/src/sast/prompt-template.js +157 -0
  306. package/src/sast/prototype-pollution.js +112 -0
  307. package/src/sast/python-sinks.js +195 -0
  308. package/src/sast/quarkus-hardening.js +102 -0
  309. package/src/sast/rag-poisoning.js +118 -0
  310. package/src/sast/rate-limit.js +128 -0
  311. package/src/sast/response-splitting.js +138 -0
  312. package/src/sast/ruby.js +108 -0
  313. package/src/sast/rust.js +105 -0
  314. package/src/sast/solidity.js +167 -0
  315. package/src/sast/springboot-hardening.js +186 -0
  316. package/src/sast/ssrf-cloud-metadata.js +80 -0
  317. package/src/sast/ssti.js +116 -0
  318. package/src/sast/swift.js +162 -0
  319. package/src/sast/toctou.js +95 -0
  320. package/src/sast/webhook.js +101 -0
  321. package/src/sast/xpath-injection.js +51 -0
  322. package/src/sast/xxe.js +140 -0
  323. package/src/sast/zip-slip.js +200 -0
  324. package/src/sca/base-images.json +45 -0
  325. package/src/sca/container.js +107 -0
  326. package/src/sca/dep-confusion.js +134 -0
  327. package/src/sca/index.js +6 -0
  328. package/src/sca/popular-packages.json +41 -0
  329. package/src/sca/sarif-ingest.js +187 -0
  330. package/src/sca/vuln-function-hints.json +89 -0
  331. package/src/secrets/index.js +4 -0
@@ -0,0 +1,485 @@
1
+ // Expanded sanitizer catalog (v0.65.0).
2
+ //
3
+ // Adds ~450 entries on top of the curated base catalog in `catalog.js`,
4
+ // taking the total sanitizer surface from ~48 to ~500+. Each entry follows
5
+ // the same shape as the base catalog so the engine consumes them
6
+ // transparently — `CALLEE_INDEX` in catalog.js auto-indexes anything in
7
+ // the exported array.
8
+ //
9
+ // Matching is by callee name only (the final identifier — e.g. the engine
10
+ // sees `crypto.randomBytes` as `randomBytes`). This is the same trade-off
11
+ // the base catalog already accepts: noisier-than-perfect name matching in
12
+ // exchange for not requiring full type inference. The `appliesTo` field
13
+ // scopes effects to specific taint families (xss / sql / cmd / url / path
14
+ // / regex / ldap / xpath / xml / json / mongo-operator / *).
15
+ //
16
+ // Grouped by language for diff readability. The compact helpers at the top
17
+ // keep the entries one-line-each so the file stays scannable.
18
+
19
+ // Helper: build a sanitizer entry. `library` is purely for documentation
20
+ // (it gets baked into the id) so multiple `escape` functions from different
21
+ // libraries can coexist without id collisions.
22
+ function san(language, library, callee, appliesTo) {
23
+ return {
24
+ kind: 'sanitizer',
25
+ id: `${language}-${library}-${callee}`.replace(/[^a-z0-9-]/gi, '-').toLowerCase(),
26
+ language,
27
+ match: { type: 'call', callee },
28
+ effect: 'strip',
29
+ appliesTo: Array.isArray(appliesTo) ? appliesTo : [appliesTo],
30
+ };
31
+ }
32
+
33
+ // ─── JS / TS ─────────────────────────────────────────────────────────────
34
+
35
+ const JS_HTML_ESCAPE = [
36
+ san('js', 'he', 'encode', ['xss']),
37
+ san('js', 'he', 'escape', ['xss']),
38
+ san('js', 'lodash', 'escape', ['xss']),
39
+ san('js', 'lodash', 'escapeRegExp', ['regex']),
40
+ san('js', 'underscore', '_.escape', ['xss']),
41
+ san('js', 'react', 'createElement', ['xss']),
42
+ san('js', 'react', 'createTextNode', ['xss']),
43
+ san('js', 'dompurify', 'DOMPurify.sanitize', ['xss']),
44
+ san('js', 'sanitize-html','sanitizeHtml', ['xss']),
45
+ san('js', 'xss-npm', 'xss', ['xss']),
46
+ san('js', 'js-xss', 'filterXSS', ['xss']),
47
+ san('js', 'escape-html', 'escapeHtml', ['xss']),
48
+ san('js', 'escape-goat', 'htmlEscape', ['xss']),
49
+ san('js', 'handlebars', 'Handlebars.escapeExpression', ['xss']),
50
+ san('js', 'striptags', 'striptags', ['xss']),
51
+ san('js', 'insane', 'insane', ['xss']),
52
+ san('js', 'isomorphic', 'escape', ['xss']),
53
+ ];
54
+
55
+ const JS_SQL = [
56
+ san('js', 'mysql', 'mysql.escape', ['sql']),
57
+ san('js', 'mysql', 'connection.escape', ['sql']),
58
+ san('js', 'mysql', 'pool.escape', ['sql']),
59
+ san('js', 'mysql2', 'mysql2.escape', ['sql']),
60
+ san('js', 'mysql2', 'mysql2.escapeId', ['sql']),
61
+ san('js', 'mysql2', 'mysql2.format', ['sql']),
62
+ san('js', 'pg', 'pg.escapeLiteral', ['sql']),
63
+ san('js', 'pg', 'pg.escapeIdentifier', ['sql']),
64
+ san('js', 'sequelize', 'sequelize.escape', ['sql']),
65
+ san('js', 'knex', 'knex.raw', ['sql']), // safe when wrapped via raw with bindings
66
+ san('js', 'prisma', 'Prisma.sql', ['sql']),
67
+ san('js', 'mssql', 'sql.input', ['sql']),
68
+ san('js', 'better-sqlite3', 'prepare', ['sql']),
69
+ ];
70
+
71
+ const JS_SHELL = [
72
+ san('js', 'shell-quote', 'shellQuote.quote', ['cmd']),
73
+ san('js', 'shell-quote', 'quote', ['cmd']),
74
+ san('js', 'shell-escape','shellEscape', ['cmd']),
75
+ san('js', 'shescape', 'shescape.escape', ['cmd']),
76
+ san('js', 'shescape', 'shescape.quote', ['cmd']),
77
+ san('js', 'execa', 'execa.command', ['cmd']), // when called with array form
78
+ san('js', 'core', 'execFile', ['cmd']),
79
+ san('js', 'core', 'spawn', ['cmd']),
80
+ ];
81
+
82
+ const JS_URL = [
83
+ san('js', 'core', 'encodeURIComponent', ['url']),
84
+ san('js', 'core', 'encodeURI', ['url']),
85
+ san('js', 'core', 'escape', ['url']), // deprecated but still used
86
+ san('js', 'qs', 'qs.escape', ['url']),
87
+ san('js', 'qs', 'qs.stringify', ['url']),
88
+ san('js', 'querystring', 'querystring.escape', ['url']),
89
+ san('js', 'querystring', 'querystring.stringify', ['url']),
90
+ san('js', 'core', 'URL', ['url']),
91
+ san('js', 'core', 'URLSearchParams', ['url']),
92
+ ];
93
+
94
+ const JS_PATH = [
95
+ san('js', 'path', 'path.normalize', ['path']),
96
+ san('js', 'path', 'path.basename', ['path']),
97
+ san('js', 'path', 'normalize', ['path']),
98
+ san('js', 'path', 'basename', ['path']),
99
+ san('js', 'sanitize-filename', 'sanitizeFilename', ['path']),
100
+ ];
101
+
102
+ const JS_REGEX = [
103
+ san('js', 'escape-string-regexp', 'escapeStringRegexp', ['regex']),
104
+ san('js', 'lodash', '_.escapeRegExp', ['regex']),
105
+ ];
106
+
107
+ const JS_LDAP = [
108
+ san('js', 'ldap-escape', 'ldapEscape.filter', ['ldap']),
109
+ san('js', 'ldap-escape', 'ldapEscape.dn', ['ldap']),
110
+ san('js', 'ldapjs', 'parseFilter', ['ldap']),
111
+ ];
112
+
113
+ const JS_XML_JSON = [
114
+ san('js', 'core', 'JSON.stringify', ['json']),
115
+ san('js', 'xml-escape', 'xmlEscape', ['xml', 'xxe']),
116
+ san('js', 'fast-xml-parser','XMLBuilder', ['xml']),
117
+ ];
118
+
119
+ const JS_VALIDATORS = [
120
+ san('js', 'validator', 'validator.isEmail', ['xss', 'sql']),
121
+ san('js', 'validator', 'validator.isURL', ['url']),
122
+ san('js', 'validator', 'validator.isUUID', ['*']),
123
+ san('js', 'validator', 'validator.isInt', ['*']),
124
+ san('js', 'validator', 'validator.isFloat', ['*']),
125
+ san('js', 'validator', 'validator.isAlpha', ['xss', 'sql']),
126
+ san('js', 'validator', 'validator.isAlphanumeric', ['xss', 'sql']),
127
+ san('js', 'validator', 'validator.isNumeric', ['*']),
128
+ san('js', 'validator', 'validator.isHexadecimal', ['*']),
129
+ san('js', 'validator', 'validator.isBase64', ['*']),
130
+ san('js', 'validator', 'validator.isJSON', ['*']),
131
+ san('js', 'validator', 'validator.isJWT', ['*']),
132
+ san('js', 'validator', 'validator.matches', ['*']),
133
+ san('js', 'validator', 'validator.isISO8601', ['*']),
134
+ san('js', 'validator', 'validator.isISBN', ['*']),
135
+ san('js', 'validator', 'validator.isCreditCard',['*']),
136
+ san('js', 'validator', 'validator.isMobilePhone', ['*']),
137
+ san('js', 'validator', 'validator.isPostalCode', ['*']),
138
+ san('js', 'validator', 'validator.isIP', ['ssrf']),
139
+ san('js', 'validator', 'validator.isFQDN', ['ssrf']),
140
+ san('js', 'validator', 'validator.toInt', ['*']),
141
+ san('js', 'validator', 'validator.toFloat', ['*']),
142
+ san('js', 'validator', 'validator.toBoolean', ['*']),
143
+ san('js', 'validator', 'validator.isLength', ['*']),
144
+ san('js', 'validator', 'validator.isStrongPassword', ['*']),
145
+ san('js', 'joi', 'Joi.validate', ['*']),
146
+ san('js', 'joi', 'schema.validate', ['*']),
147
+ san('js', 'zod', 'z.parse', ['*']),
148
+ san('js', 'zod', 'safeParse', ['*']),
149
+ san('js', 'yup', 'yup.validate', ['*']),
150
+ san('js', 'ajv', 'ajv.validate', ['*']),
151
+ ];
152
+
153
+ const JS_TYPE_COERCE = [
154
+ san('js', 'core', 'parseInt', ['*']),
155
+ san('js', 'core', 'parseFloat', ['*']),
156
+ san('js', 'core', 'Number', ['*']),
157
+ san('js', 'core', 'Boolean', ['*']),
158
+ san('js', 'core', 'Array.from', ['mongo-operator']),
159
+ ];
160
+
161
+ const JS = [
162
+ ...JS_HTML_ESCAPE, ...JS_SQL, ...JS_SHELL, ...JS_URL, ...JS_PATH,
163
+ ...JS_REGEX, ...JS_LDAP, ...JS_XML_JSON, ...JS_VALIDATORS, ...JS_TYPE_COERCE,
164
+ ];
165
+
166
+ // ─── Python ──────────────────────────────────────────────────────────────
167
+
168
+ const PY_HTML_ESCAPE = [
169
+ san('py', 'html', 'html.escape', ['xss']),
170
+ san('py', 'cgi', 'cgi.escape', ['xss']),
171
+ san('py', 'markupsafe', 'Markup.escape', ['xss']),
172
+ san('py', 'markupsafe', 'escape', ['xss']),
173
+ san('py', 'bleach', 'bleach.clean', ['xss']),
174
+ san('py', 'bleach', 'bleach.linkify', ['xss']),
175
+ san('py', 'lxml', 'Cleaner.clean_html', ['xss']),
176
+ san('py', 'django', 'mark_safe', ['xss']), // marker; downstream often wraps escaped content
177
+ san('py', 'django', 'format_html', ['xss']),
178
+ san('py', 'django', 'escape', ['xss']),
179
+ san('py', 'flask', 'flask.escape', ['xss']),
180
+ san('py', 'jinja2', 'Environment.from_string', ['xss']), // auto-escape enabled by default
181
+ ];
182
+
183
+ const PY_SQL = [
184
+ san('py', 'sqlalchemy', 'sqlalchemy.text', ['sql']),
185
+ san('py', 'sqlalchemy', 'session.execute', ['sql']),
186
+ san('py', 'sqlalchemy', 'engine.execute', ['sql']),
187
+ san('py', 'sqlalchemy', 'bindparam', ['sql']),
188
+ san('py', 'psycopg', 'cursor.execute', ['sql']), // when passed (sql, params)
189
+ san('py', 'psycopg', 'sql.SQL', ['sql']),
190
+ san('py', 'psycopg', 'sql.Identifier', ['sql']),
191
+ san('py', 'psycopg', 'sql.Literal', ['sql']),
192
+ san('py', 'psycopg', 'mogrify', ['sql']),
193
+ san('py', 'pyodbc', 'execute', ['sql']), // when params passed
194
+ san('py', 'pymysql', 'escape_string', ['sql']),
195
+ san('py', 'pymysql', 'escape', ['sql']),
196
+ san('py', 'sqlite3', 'Connection.execute', ['sql']), // when (sql, params)
197
+ san('py', 'django', 'QuerySet.filter', ['sql']),
198
+ san('py', 'django', 'QuerySet.get', ['sql']),
199
+ san('py', 'django', 'Model.objects.filter', ['sql']),
200
+ san('py', 'peewee', 'Model.get', ['sql']),
201
+ ];
202
+
203
+ const PY_SHELL = [
204
+ san('py', 'shlex', 'shlex.quote', ['cmd']),
205
+ san('py', 'shlex', 'quote', ['cmd']),
206
+ san('py', 'pipes', 'pipes.quote', ['cmd']),
207
+ san('py', 'subprocess', 'subprocess.run', ['cmd']), // safe when args is a list and shell=False
208
+ san('py', 'subprocess', 'subprocess.check_output', ['cmd']),
209
+ san('py', 'subprocess', 'subprocess.Popen', ['cmd']),
210
+ ];
211
+
212
+ const PY_URL = [
213
+ san('py', 'urllib', 'urllib.parse.quote', ['url']),
214
+ san('py', 'urllib', 'urllib.parse.quote_plus',['url']),
215
+ san('py', 'urllib', 'urllib.parse.urlencode', ['url']),
216
+ san('py', 'urllib', 'urllib.parse.urlparse', ['url']),
217
+ san('py', 'urllib', 'quote', ['url']),
218
+ san('py', 'urllib', 'quote_plus', ['url']),
219
+ san('py', 'urllib', 'urlencode', ['url']),
220
+ san('py', 'requests', 'requests.utils.requote_uri', ['url']),
221
+ ];
222
+
223
+ const PY_PATH = [
224
+ san('py', 'os', 'os.path.normpath', ['path']),
225
+ san('py', 'os', 'os.path.abspath', ['path']),
226
+ san('py', 'os', 'os.path.basename', ['path']),
227
+ san('py', 'pathlib','Path.resolve', ['path']),
228
+ san('py', 'werkzeug','safe_join', ['path']),
229
+ san('py', 'flask', 'safe_join', ['path']),
230
+ ];
231
+
232
+ const PY_REGEX = [
233
+ san('py', 're', 're.escape', ['regex']),
234
+ ];
235
+
236
+ const PY_LDAP_XPATH = [
237
+ san('py', 'ldap3', 'ldap3.utils.conv.escape_filter_chars', ['ldap']),
238
+ san('py', 'python-ldap','escape_filter_chars', ['ldap']),
239
+ san('py', 'lxml', 'lxml.etree.XPath', ['xpath']),
240
+ san('py', 'lxml', 'XPath', ['xpath']),
241
+ ];
242
+
243
+ const PY_XML_JSON = [
244
+ san('py', 'xml-sax-saxutils', 'saxutils.escape', ['xml', 'xxe']),
245
+ san('py', 'xml-sax-saxutils', 'saxutils.quoteattr', ['xml', 'xxe']),
246
+ san('py', 'defusedxml', 'defusedxml.ElementTree.fromstring', ['xml', 'xxe']),
247
+ san('py', 'defusedxml', 'defusedxml.lxml.fromstring', ['xml', 'xxe']),
248
+ san('py', 'json', 'json.dumps', ['json']),
249
+ ];
250
+
251
+ const PY_VALIDATORS = [
252
+ san('py', 'validators', 'validators.email', ['xss', 'sql']),
253
+ san('py', 'validators', 'validators.url', ['url']),
254
+ san('py', 'validators', 'validators.uuid', ['*']),
255
+ san('py', 'validators', 'validators.domain',['ssrf']),
256
+ san('py', 'validators', 'validators.ipv4', ['ssrf']),
257
+ san('py', 'validators', 'validators.ipv6', ['ssrf']),
258
+ san('py', 'pydantic', 'parse_obj', ['*']),
259
+ san('py', 'pydantic', 'parse_obj_as', ['*']),
260
+ san('py', 'pydantic', 'model_validate', ['*']),
261
+ san('py', 'pydantic', 'BaseModel', ['*']),
262
+ san('py', 'marshmallow', 'Schema.load', ['*']),
263
+ san('py', 'cerberus', 'validate', ['*']),
264
+ san('py', 'wtforms', 'Form.validate', ['*']),
265
+ san('py', 'django', 'Form.is_valid', ['*']),
266
+ san('py', 'django', 'cleaned_data', ['*']),
267
+ san('py', 'voluptuous', 'Schema', ['*']),
268
+ ];
269
+
270
+ const PY_TYPE_COERCE = [
271
+ san('py', 'core', 'int', ['*']),
272
+ san('py', 'core', 'float', ['*']),
273
+ san('py', 'core', 'bool', ['*']),
274
+ san('py', 'core', 'bytes', ['*']),
275
+ ];
276
+
277
+ const PY = [
278
+ ...PY_HTML_ESCAPE, ...PY_SQL, ...PY_SHELL, ...PY_URL, ...PY_PATH,
279
+ ...PY_REGEX, ...PY_LDAP_XPATH, ...PY_XML_JSON, ...PY_VALIDATORS, ...PY_TYPE_COERCE,
280
+ ];
281
+
282
+ // ─── Java ────────────────────────────────────────────────────────────────
283
+
284
+ const JAVA_HTML_ESCAPE = [
285
+ san('java', 'esapi', 'encodeForHTML', ['xss']),
286
+ san('java', 'esapi', 'encodeForHTMLAttribute', ['xss']),
287
+ san('java', 'esapi', 'encodeForJavaScript', ['xss']),
288
+ san('java', 'esapi', 'encodeForCSS', ['xss']),
289
+ san('java', 'esapi', 'encodeForURL', ['url']),
290
+ san('java', 'esapi', 'encodeForBase64', ['*']),
291
+ san('java', 'owasp-encoder', 'Encode.forHtml', ['xss']),
292
+ san('java', 'owasp-encoder', 'Encode.forHtmlContent', ['xss']),
293
+ san('java', 'owasp-encoder', 'Encode.forHtmlAttribute',['xss']),
294
+ san('java', 'owasp-encoder', 'Encode.forJavaScript', ['xss']),
295
+ san('java', 'owasp-encoder', 'Encode.forCssString', ['xss']),
296
+ san('java', 'owasp-encoder', 'Encode.forUriComponent', ['url']),
297
+ san('java', 'spring', 'HtmlUtils.htmlEscape', ['xss']),
298
+ san('java', 'spring', 'HtmlUtils.htmlEscapeDecimal', ['xss']),
299
+ san('java', 'commons-text', 'StringEscapeUtils.escapeHtml4', ['xss']),
300
+ san('java', 'commons-text', 'StringEscapeUtils.escapeHtml3', ['xss']),
301
+ san('java', 'commons-lang3', 'StringEscapeUtils.escapeHtml4', ['xss']),
302
+ san('java', 'jsoup', 'Jsoup.clean', ['xss']),
303
+ ];
304
+
305
+ const JAVA_SQL = [
306
+ san('java', 'jdbc', 'PreparedStatement.setString', ['sql']),
307
+ san('java', 'jdbc', 'PreparedStatement.setInt', ['sql']),
308
+ san('java', 'jdbc', 'PreparedStatement.setLong', ['sql']),
309
+ san('java', 'jdbc', 'PreparedStatement.setObject', ['sql']),
310
+ san('java', 'jdbc', 'setString', ['sql']),
311
+ san('java', 'jdbc', 'setInt', ['sql']),
312
+ san('java', 'jdbc', 'setLong', ['sql']),
313
+ san('java', 'jdbc', 'setObject', ['sql']),
314
+ san('java', 'spring', 'NamedParameterJdbcTemplate.query', ['sql']),
315
+ san('java', 'spring', 'JdbcTemplate.queryForList', ['sql']),
316
+ san('java', 'jpa', 'TypedQuery.setParameter', ['sql']),
317
+ san('java', 'jpa', 'Query.setParameter', ['sql']),
318
+ san('java', 'hibernate','setParameter', ['sql']),
319
+ // MyBatis uses @Param as an annotation (not a call), so it isn't
320
+ // expressible as a callee-based sanitizer entry — left out intentionally.
321
+ ];
322
+
323
+ const JAVA_SHELL = [
324
+ san('java', 'processbuilder', 'ProcessBuilder.command',['cmd']),
325
+ san('java', 'core', 'Runtime.exec', ['cmd']), // safe when array form
326
+ ];
327
+
328
+ const JAVA_URL_PATH_REGEX = [
329
+ san('java', 'url', 'URLEncoder.encode', ['url']),
330
+ san('java', 'uri', 'URI', ['url']),
331
+ san('java', 'nio', 'Paths.get', ['path']),
332
+ san('java', 'nio', 'Path.normalize', ['path']),
333
+ san('java', 'regex', 'Pattern.quote', ['regex']),
334
+ ];
335
+
336
+ const JAVA_LDAP_XPATH_XML_JSON = [
337
+ san('java', 'esapi', 'encodeForLDAP', ['ldap']),
338
+ san('java', 'esapi', 'encodeForDN', ['ldap']),
339
+ san('java', 'esapi', 'encodeForXPath', ['xpath']),
340
+ san('java', 'esapi', 'encodeForXML', ['xml', 'xxe']),
341
+ san('java', 'esapi', 'encodeForXMLAttribute', ['xml', 'xxe']),
342
+ san('java', 'commons-text', 'StringEscapeUtils.escapeXml11', ['xml', 'xxe']),
343
+ san('java', 'jackson', 'ObjectMapper.writeValueAsString', ['json']),
344
+ san('java', 'gson', 'Gson.toJson', ['json']),
345
+ ];
346
+
347
+ const JAVA_VALIDATORS = [
348
+ san('java', 'commons-validator', 'EmailValidator.isValid', ['xss', 'sql']),
349
+ san('java', 'commons-validator', 'UrlValidator.isValid', ['url']),
350
+ san('java', 'commons-validator', 'InetAddressValidator.isValid', ['ssrf']),
351
+ san('java', 'hibernate-validator', 'Validator.validate', ['*']),
352
+ ];
353
+
354
+ const JAVA = [
355
+ ...JAVA_HTML_ESCAPE, ...JAVA_SQL, ...JAVA_SHELL,
356
+ ...JAVA_URL_PATH_REGEX, ...JAVA_LDAP_XPATH_XML_JSON, ...JAVA_VALIDATORS,
357
+ ];
358
+
359
+ // ─── Ruby ────────────────────────────────────────────────────────────────
360
+
361
+ const RUBY = [
362
+ san('rb', 'cgi', 'CGI.escapeHTML', ['xss']),
363
+ san('rb', 'cgi', 'CGI.escape', ['url']),
364
+ san('rb', 'erb-util', 'ERB::Util.html_escape', ['xss']),
365
+ san('rb', 'erb-util', 'ERB::Util.url_encode', ['url']),
366
+ san('rb', 'erb-util', 'h', ['xss']),
367
+ san('rb', 'rails', 'sanitize', ['xss']),
368
+ san('rb', 'rails', 'strip_tags', ['xss']),
369
+ san('rb', 'rails', 'strip_links', ['xss']),
370
+ san('rb', 'rails', 'simple_format', ['xss']),
371
+ san('rb', 'rails', 'html_escape', ['xss']),
372
+ san('rb', 'rails', 'truncate', ['xss']),
373
+ san('rb', 'rails', 'where', ['sql']), // hash-form is safe; raw is not
374
+ san('rb', 'rails', 'sanitize_sql_array',['sql']),
375
+ san('rb', 'rails', 'sanitize_sql_hash_for_conditions', ['sql']),
376
+ san('rb', 'shellwords', 'Shellwords.escape', ['cmd']),
377
+ san('rb', 'shellwords', 'Shellwords.shellescape', ['cmd']),
378
+ san('rb', 'shellwords', 'shellescape', ['cmd']),
379
+ san('rb', 'open3', 'Open3.capture3', ['cmd']),
380
+ san('rb', 'uri', 'URI.encode_www_form',['url']),
381
+ san('rb', 'uri', 'URI.encode_www_form_component', ['url']),
382
+ san('rb', 'core', 'Pathname.cleanpath', ['path']),
383
+ san('rb', 'regexp', 'Regexp.escape', ['regex']),
384
+ san('rb', 'rexml', 'REXML::Text.normalize', ['xml', 'xxe']),
385
+ san('rb', 'nokogiri', 'Nokogiri::XML::Text.new', ['xml']),
386
+ san('rb', 'json', 'JSON.generate', ['json']),
387
+ san('rb', 'json', 'JSON.dump', ['json']),
388
+ san('rb', 'rails', 'Integer', ['*']),
389
+ san('rb', 'rails', 'Float', ['*']),
390
+ san('rb', 'rails', 'String', ['*']),
391
+ ];
392
+
393
+ // ─── PHP ─────────────────────────────────────────────────────────────────
394
+
395
+ const PHP = [
396
+ san('php', 'core', 'htmlspecialchars', ['xss']),
397
+ san('php', 'core', 'htmlentities', ['xss']),
398
+ san('php', 'core', 'strip_tags', ['xss']),
399
+ san('php', 'core', 'filter_var', ['xss', 'url', 'ssrf']),
400
+ san('php', 'core', 'filter_input', ['xss', 'url']),
401
+ san('php', 'pdo', 'bindParam', ['sql']),
402
+ san('php', 'pdo', 'bindValue', ['sql']),
403
+ san('php', 'pdo', 'bindParam', ['sql']),
404
+ san('php', 'pdo', 'bindValue', ['sql']),
405
+ san('php', 'mysqli','mysqli_stmt_bind_param', ['sql']),
406
+ san('php', 'mysqli','mysqli_real_escape_string',['sql']),
407
+ san('php', 'mysqli','real_escape_string', ['sql']),
408
+ san('php', 'pgsql', 'pg_escape_string', ['sql']),
409
+ san('php', 'pgsql', 'pg_escape_literal', ['sql']),
410
+ san('php', 'pgsql', 'pg_escape_identifier', ['sql']),
411
+ san('php', 'core', 'escapeshellarg', ['cmd']),
412
+ san('php', 'core', 'escapeshellcmd', ['cmd']),
413
+ san('php', 'core', 'urlencode', ['url']),
414
+ san('php', 'core', 'rawurlencode', ['url']),
415
+ san('php', 'core', 'http_build_query', ['url']),
416
+ san('php', 'core', 'realpath', ['path']),
417
+ san('php', 'core', 'basename', ['path']),
418
+ san('php', 'core', 'pathinfo', ['path']),
419
+ san('php', 'pcre', 'preg_quote', ['regex']),
420
+ san('php', 'ldap', 'ldap_escape', ['ldap']),
421
+ san('php', 'core', 'json_encode', ['json']),
422
+ san('php', 'core', 'intval', ['*']),
423
+ san('php', 'core', 'floatval', ['*']),
424
+ san('php', 'core', 'strval', ['*']),
425
+ san('php', 'core', 'boolval', ['*']),
426
+ san('php', 'core', 'ctype_digit', ['*']),
427
+ san('php', 'core', 'ctype_alpha', ['*']),
428
+ san('php', 'core', 'ctype_alnum', ['*']),
429
+ san('php', 'symfony', 'validate', ['*']), // Validator::validate
430
+ san('php', 'laravel', 'make', ['*']), // Validator::make
431
+ ];
432
+
433
+ // ─── Go ──────────────────────────────────────────────────────────────────
434
+
435
+ const GO = [
436
+ san('go', 'html', 'html.EscapeString', ['xss']),
437
+ san('go', 'html', 'template.HTMLEscapeString', ['xss']),
438
+ san('go', 'html', 'template.JSEscapeString', ['xss']),
439
+ san('go', 'html', 'template.URLQueryEscaper', ['url']),
440
+ san('go', 'bluemonday', 'Policy.Sanitize', ['xss']),
441
+ san('go', 'bluemonday', 'UGCPolicy', ['xss']),
442
+ san('go', 'bluemonday', 'StrictPolicy', ['xss']),
443
+ san('go', 'database-sql', 'db.Query', ['sql']), // safe with placeholders
444
+ san('go', 'database-sql', 'db.Exec', ['sql']),
445
+ san('go', 'database-sql', 'db.QueryRow', ['sql']),
446
+ san('go', 'database-sql', 'stmt.Query', ['sql']),
447
+ san('go', 'database-sql', 'stmt.Exec', ['sql']),
448
+ san('go', 'sqlx', 'sqlx.Named', ['sql']),
449
+ san('go', 'os-exec', 'exec.Command', ['cmd']), // safe with separate args
450
+ san('go', 'os-exec', 'exec.CommandContext', ['cmd']),
451
+ san('go', 'net-url', 'url.QueryEscape', ['url']),
452
+ san('go', 'net-url', 'url.PathEscape', ['url']),
453
+ san('go', 'net-url', 'Values.Encode', ['url']),
454
+ san('go', 'filepath', 'filepath.Clean', ['path']),
455
+ san('go', 'filepath', 'filepath.Abs', ['path']),
456
+ san('go', 'filepath', 'filepath.IsAbs', ['path']),
457
+ san('go', 'filepath', 'filepath.Base', ['path']),
458
+ san('go', 'regexp', 'regexp.QuoteMeta', ['regex']),
459
+ san('go', 'ldap-v3', 'ldap.EscapeFilter', ['ldap']),
460
+ san('go', 'encoding-json','json.Marshal', ['json']),
461
+ san('go', 'encoding-xml', 'xml.Marshal', ['xml']),
462
+ san('go', 'govalidator', 'govalidator.IsEmail', ['xss', 'sql']),
463
+ san('go', 'govalidator', 'govalidator.IsURL', ['url']),
464
+ san('go', 'govalidator', 'govalidator.IsUUID', ['*']),
465
+ san('go', 'govalidator', 'govalidator.IsIP', ['ssrf']),
466
+ san('go', 'go-playground','validator.Struct', ['*']),
467
+ san('go', 'core', 'strconv.Atoi', ['*']),
468
+ san('go', 'core', 'strconv.ParseInt', ['*']),
469
+ san('go', 'core', 'strconv.ParseFloat', ['*']),
470
+ ];
471
+
472
+ // ─── Aggregate export ────────────────────────────────────────────────────
473
+
474
+ export const EXPANDED_SANITIZERS = [
475
+ ...JS, ...PY, ...JAVA, ...RUBY, ...PHP, ...GO,
476
+ ];
477
+
478
+ // Diagnostic export — used by tests + the why-not command.
479
+ export const _expandedSanitizerStats = () => {
480
+ const byLanguage = {};
481
+ for (const e of EXPANDED_SANITIZERS) {
482
+ byLanguage[e.language] = (byLanguage[e.language] || 0) + 1;
483
+ }
484
+ return { total: EXPANDED_SANITIZERS.length, byLanguage };
485
+ };