@quantakrypto/core 0.4.2 → 0.4.4

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 (223) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +38 -10
  3. package/dist/agent-types.js.map +1 -1
  4. package/dist/baseline.js.map +1 -1
  5. package/dist/cache.js.map +1 -1
  6. package/dist/cbom-merge.d.ts +9 -0
  7. package/dist/cbom-merge.d.ts.map +1 -0
  8. package/dist/cbom-merge.js +99 -0
  9. package/dist/cbom-merge.js.map +1 -0
  10. package/dist/cbom.js.map +1 -1
  11. package/dist/changed.js.map +1 -1
  12. package/dist/codemods/config-toggle.js.map +1 -1
  13. package/dist/codemods/registry.js.map +1 -1
  14. package/dist/comments.d.ts +29 -2
  15. package/dist/comments.d.ts.map +1 -1
  16. package/dist/comments.js +178 -18
  17. package/dist/comments.js.map +1 -1
  18. package/dist/config.js.map +1 -1
  19. package/dist/cwe.js.map +1 -1
  20. package/dist/dependencies.d.ts +3 -2
  21. package/dist/dependencies.d.ts.map +1 -1
  22. package/dist/dependencies.js +138 -2
  23. package/dist/dependencies.js.map +1 -1
  24. package/dist/detect-utils.d.ts +19 -4
  25. package/dist/detect-utils.d.ts.map +1 -1
  26. package/dist/detect-utils.js +43 -6
  27. package/dist/detect-utils.js.map +1 -1
  28. package/dist/detectors/c.d.ts +4 -2
  29. package/dist/detectors/c.d.ts.map +1 -1
  30. package/dist/detectors/c.js +382 -3
  31. package/dist/detectors/c.js.map +1 -1
  32. package/dist/detectors/cicd.d.ts +27 -0
  33. package/dist/detectors/cicd.d.ts.map +1 -0
  34. package/dist/detectors/cicd.js +116 -0
  35. package/dist/detectors/cicd.js.map +1 -0
  36. package/dist/detectors/cloud-kms.d.ts +21 -0
  37. package/dist/detectors/cloud-kms.d.ts.map +1 -0
  38. package/dist/detectors/cloud-kms.js +57 -0
  39. package/dist/detectors/cloud-kms.js.map +1 -0
  40. package/dist/detectors/cloudformation.d.ts +30 -0
  41. package/dist/detectors/cloudformation.d.ts.map +1 -0
  42. package/dist/detectors/cloudformation.js +170 -0
  43. package/dist/detectors/cloudformation.js.map +1 -0
  44. package/dist/detectors/csharp.d.ts.map +1 -1
  45. package/dist/detectors/csharp.js +141 -3
  46. package/dist/detectors/csharp.js.map +1 -1
  47. package/dist/detectors/database.d.ts +17 -0
  48. package/dist/detectors/database.d.ts.map +1 -0
  49. package/dist/detectors/database.js +60 -0
  50. package/dist/detectors/database.js.map +1 -0
  51. package/dist/detectors/dnssec.d.ts +55 -0
  52. package/dist/detectors/dnssec.d.ts.map +1 -0
  53. package/dist/detectors/dnssec.js +107 -0
  54. package/dist/detectors/dnssec.js.map +1 -0
  55. package/dist/detectors/elixir.d.ts +20 -0
  56. package/dist/detectors/elixir.d.ts.map +1 -0
  57. package/dist/detectors/elixir.js +195 -0
  58. package/dist/detectors/elixir.js.map +1 -0
  59. package/dist/detectors/go.d.ts +5 -3
  60. package/dist/detectors/go.d.ts.map +1 -1
  61. package/dist/detectors/go.js +187 -3
  62. package/dist/detectors/go.js.map +1 -1
  63. package/dist/detectors/java.d.ts.map +1 -1
  64. package/dist/detectors/java.js +169 -4
  65. package/dist/detectors/java.js.map +1 -1
  66. package/dist/detectors/jose.d.ts +20 -0
  67. package/dist/detectors/jose.d.ts.map +1 -0
  68. package/dist/detectors/jose.js +62 -0
  69. package/dist/detectors/jose.js.map +1 -0
  70. package/dist/detectors/jwk.d.ts +25 -0
  71. package/dist/detectors/jwk.d.ts.map +1 -0
  72. package/dist/detectors/jwk.js +95 -0
  73. package/dist/detectors/jwk.js.map +1 -0
  74. package/dist/detectors/k8s.d.ts +17 -0
  75. package/dist/detectors/k8s.d.ts.map +1 -0
  76. package/dist/detectors/k8s.js +85 -0
  77. package/dist/detectors/k8s.js.map +1 -0
  78. package/dist/detectors/mesh.d.ts +35 -0
  79. package/dist/detectors/mesh.d.ts.map +1 -0
  80. package/dist/detectors/mesh.js +109 -0
  81. package/dist/detectors/mesh.js.map +1 -0
  82. package/dist/detectors/messaging.d.ts +16 -0
  83. package/dist/detectors/messaging.d.ts.map +1 -0
  84. package/dist/detectors/messaging.js +72 -0
  85. package/dist/detectors/messaging.js.map +1 -0
  86. package/dist/detectors/pem.d.ts.map +1 -1
  87. package/dist/detectors/pem.js +50 -2
  88. package/dist/detectors/pem.js.map +1 -1
  89. package/dist/detectors/php.d.ts +24 -0
  90. package/dist/detectors/php.d.ts.map +1 -0
  91. package/dist/detectors/php.js +167 -0
  92. package/dist/detectors/php.js.map +1 -0
  93. package/dist/detectors/python.d.ts.map +1 -1
  94. package/dist/detectors/python.js +144 -3
  95. package/dist/detectors/python.js.map +1 -1
  96. package/dist/detectors/ruby.d.ts +9 -5
  97. package/dist/detectors/ruby.d.ts.map +1 -1
  98. package/dist/detectors/ruby.js +122 -2
  99. package/dist/detectors/ruby.js.map +1 -1
  100. package/dist/detectors/rust.d.ts +8 -3
  101. package/dist/detectors/rust.d.ts.map +1 -1
  102. package/dist/detectors/rust.js +253 -3
  103. package/dist/detectors/rust.js.map +1 -1
  104. package/dist/detectors/secrets.d.ts +21 -0
  105. package/dist/detectors/secrets.d.ts.map +1 -0
  106. package/dist/detectors/secrets.js +79 -0
  107. package/dist/detectors/secrets.js.map +1 -0
  108. package/dist/detectors/source.d.ts.map +1 -1
  109. package/dist/detectors/source.js +305 -52
  110. package/dist/detectors/source.js.map +1 -1
  111. package/dist/detectors/stateful-hbs.d.ts +22 -0
  112. package/dist/detectors/stateful-hbs.d.ts.map +1 -0
  113. package/dist/detectors/stateful-hbs.js +142 -0
  114. package/dist/detectors/stateful-hbs.js.map +1 -0
  115. package/dist/detectors/terraform.d.ts +21 -0
  116. package/dist/detectors/terraform.d.ts.map +1 -0
  117. package/dist/detectors/terraform.js +123 -0
  118. package/dist/detectors/terraform.js.map +1 -0
  119. package/dist/detectors/vpn.d.ts +22 -0
  120. package/dist/detectors/vpn.d.ts.map +1 -0
  121. package/dist/detectors/vpn.js +99 -0
  122. package/dist/detectors/vpn.js.map +1 -0
  123. package/dist/errors.js.map +1 -1
  124. package/dist/evidence.d.ts +53 -0
  125. package/dist/evidence.d.ts.map +1 -0
  126. package/dist/evidence.js +81 -0
  127. package/dist/evidence.js.map +1 -0
  128. package/dist/index.d.ts +9 -2
  129. package/dist/index.d.ts.map +1 -1
  130. package/dist/index.js +10 -2
  131. package/dist/index.js.map +1 -1
  132. package/dist/inventory.d.ts +2 -0
  133. package/dist/inventory.d.ts.map +1 -1
  134. package/dist/inventory.js +27 -1
  135. package/dist/inventory.js.map +1 -1
  136. package/dist/parallel.js.map +1 -1
  137. package/dist/patch-policy.js.map +1 -1
  138. package/dist/policy.d.ts +67 -0
  139. package/dist/policy.d.ts.map +1 -0
  140. package/dist/policy.js +115 -0
  141. package/dist/policy.js.map +1 -0
  142. package/dist/redact.d.ts.map +1 -1
  143. package/dist/redact.js +39 -0
  144. package/dist/redact.js.map +1 -1
  145. package/dist/registry.d.ts +2 -2
  146. package/dist/registry.d.ts.map +1 -1
  147. package/dist/registry.js +34 -2
  148. package/dist/registry.js.map +1 -1
  149. package/dist/remediate-pipeline.d.ts +3 -0
  150. package/dist/remediate-pipeline.d.ts.map +1 -1
  151. package/dist/remediate-pipeline.js +71 -0
  152. package/dist/remediate-pipeline.js.map +1 -1
  153. package/dist/remediate-request.js.map +1 -1
  154. package/dist/remediation.d.ts +9 -3
  155. package/dist/remediation.d.ts.map +1 -1
  156. package/dist/remediation.js +17 -5
  157. package/dist/remediation.js.map +1 -1
  158. package/dist/report.d.ts +9 -0
  159. package/dist/report.d.ts.map +1 -1
  160. package/dist/report.js +38 -0
  161. package/dist/report.js.map +1 -1
  162. package/dist/scan-worker.js.map +1 -1
  163. package/dist/scan.d.ts.map +1 -1
  164. package/dist/scan.js +8 -1
  165. package/dist/scan.js.map +1 -1
  166. package/dist/severity.js.map +1 -1
  167. package/dist/standards.d.ts +96 -0
  168. package/dist/standards.d.ts.map +1 -0
  169. package/dist/standards.js +107 -0
  170. package/dist/standards.js.map +1 -0
  171. package/dist/triage.js.map +1 -1
  172. package/dist/types.d.ts +2 -2
  173. package/dist/types.d.ts.map +1 -1
  174. package/dist/types.js.map +1 -1
  175. package/dist/verify.js.map +1 -1
  176. package/dist/version.d.ts +1 -1
  177. package/dist/version.js +1 -1
  178. package/dist/version.js.map +1 -1
  179. package/dist/walk.js.map +1 -1
  180. package/dist/worktree.js.map +1 -1
  181. package/package.json +1 -1
  182. package/src/cbom-merge.ts +116 -0
  183. package/src/comments.ts +183 -18
  184. package/src/dependencies.ts +144 -4
  185. package/src/detect-utils.ts +47 -6
  186. package/src/detectors/c.ts +411 -5
  187. package/src/detectors/cicd.ts +158 -0
  188. package/src/detectors/cloud-kms.ts +87 -0
  189. package/src/detectors/cloudformation.ts +215 -0
  190. package/src/detectors/csharp.ts +154 -3
  191. package/src/detectors/database.ts +88 -0
  192. package/src/detectors/dnssec.ts +186 -0
  193. package/src/detectors/elixir.ts +237 -0
  194. package/src/detectors/go.ts +209 -6
  195. package/src/detectors/java.ts +191 -4
  196. package/src/detectors/jose.ts +94 -0
  197. package/src/detectors/jwk.ts +128 -0
  198. package/src/detectors/k8s.ts +112 -0
  199. package/src/detectors/mesh.ts +154 -0
  200. package/src/detectors/messaging.ts +98 -0
  201. package/src/detectors/pem.ts +54 -2
  202. package/src/detectors/php.ts +225 -0
  203. package/src/detectors/python.ts +153 -3
  204. package/src/detectors/ruby.ts +138 -7
  205. package/src/detectors/rust.ts +282 -7
  206. package/src/detectors/secrets.ts +114 -0
  207. package/src/detectors/source.ts +382 -72
  208. package/src/detectors/stateful-hbs.ts +180 -0
  209. package/src/detectors/terraform.ts +154 -0
  210. package/src/detectors/vpn.ts +131 -0
  211. package/src/evidence.ts +135 -0
  212. package/src/index.ts +15 -1
  213. package/src/inventory.ts +31 -1
  214. package/src/policy.ts +180 -0
  215. package/src/redact.ts +41 -0
  216. package/src/registry.ts +34 -2
  217. package/src/remediate-pipeline.ts +78 -0
  218. package/src/remediation.ts +23 -8
  219. package/src/report.ts +48 -2
  220. package/src/scan.ts +13 -1
  221. package/src/standards.ts +186 -0
  222. package/src/types.ts +3 -1
  223. package/src/version.ts +1 -1
@@ -1,9 +1,10 @@
1
1
  /**
2
2
  * Curated database of packages that primarily expose classical asymmetric
3
3
  * cryptography (and are therefore quantum-vulnerable), across multiple
4
- * ecosystems (npm, PyPI, crates.io, Go modules, Maven, RubyGems), plus a
4
+ * ecosystems (npm, PyPI, crates.io, Go modules, Maven, RubyGems, NuGet), plus a
5
5
  * manifest scanner that flags any of them found in the corresponding manifest
6
- * (package.json, requirements.txt, Cargo.toml, go.mod, pom.xml, Gemfile, …).
6
+ * (package.json, requirements.txt, Cargo.toml, go.mod, pom.xml, Gemfile,
7
+ * packages.config / *.csproj, …).
7
8
  *
8
9
  * The list is intentionally focused on libraries whose *purpose* is classical
9
10
  * public-key crypto. General-purpose packages that merely call the language's
@@ -313,6 +314,28 @@ export const vulnerableDependencies: VulnerableDependency[] = [
313
314
  algorithms: ["RSA", "ECDSA", "DSA"],
314
315
  severity: "high",
315
316
  },
317
+ {
318
+ name: "pycrypto",
319
+ ecosystem: "pypi",
320
+ reason: "Abandoned/unmaintained crypto library — classical RSA/DSA/ElGamal.",
321
+ algorithms: ["RSA", "DSA"],
322
+ severity: "high",
323
+ },
324
+ {
325
+ name: "jwcrypto",
326
+ ecosystem: "pypi",
327
+ reason: "JWK / JWS / JWE with classical RS*/ES* and ECDH-ES key agreement.",
328
+ algorithms: ["RSA", "ECDSA", "ECDH"],
329
+ severity: "medium",
330
+ },
331
+ {
332
+ name: "authlib",
333
+ ecosystem: "pypi",
334
+ reason: "OAuth / OIDC / JOSE stack using classical RS*/ES* JWT signing.",
335
+ algorithms: ["RSA", "ECDSA"],
336
+ severity: "medium",
337
+ hndl: false,
338
+ },
316
339
  {
317
340
  name: "pycryptodomex",
318
341
  ecosystem: "pypi",
@@ -422,6 +445,13 @@ export const vulnerableDependencies: VulnerableDependency[] = [
422
445
  algorithms: ["ECDSA", "ECDH"],
423
446
  severity: "high",
424
447
  },
448
+ {
449
+ name: "secp256k1",
450
+ ecosystem: "cargo",
451
+ reason: "libsecp256k1 bindings (blockchain) — classical ECDSA + ECDH.",
452
+ algorithms: ["ECDSA", "ECDH"],
453
+ severity: "high",
454
+ },
425
455
  {
426
456
  name: "ed25519-dalek",
427
457
  ecosystem: "cargo",
@@ -445,6 +475,44 @@ export const vulnerableDependencies: VulnerableDependency[] = [
445
475
  algorithms: ["RSA", "ECDSA", "EdDSA", "ECDH"],
446
476
  severity: "medium",
447
477
  },
478
+ {
479
+ name: "github.com/golang-jwt/jwt/v5",
480
+ ecosystem: "go",
481
+ reason: "golang-jwt — classical RS*/PS*/ES* JWT algorithms.",
482
+ algorithms: ["RSA", "ECDSA"],
483
+ severity: "medium",
484
+ hndl: false,
485
+ },
486
+ {
487
+ name: "github.com/golang-jwt/jwt/v4",
488
+ ecosystem: "go",
489
+ reason: "golang-jwt (v4) — classical RS*/PS*/ES* JWT algorithms.",
490
+ algorithms: ["RSA", "ECDSA"],
491
+ severity: "medium",
492
+ hndl: false,
493
+ },
494
+ {
495
+ name: "github.com/go-jose/go-jose/v4",
496
+ ecosystem: "go",
497
+ reason: "go-jose — classical JOSE (RSA/ECDSA signatures, ECDH-ES key agreement).",
498
+ algorithms: ["RSA", "ECDSA", "ECDH"],
499
+ severity: "medium",
500
+ },
501
+ {
502
+ name: "github.com/cloudflare/circl",
503
+ ecosystem: "go",
504
+ reason:
505
+ "Cloudflare CIRCL — classical ECDH/EdDSA curves (X25519, X448, Ed25519, P-256); also ships PQC (ML-KEM/ML-DSA + hybrids), so migrate the classical *usage*, not the package.",
506
+ algorithms: ["ECDH", "EdDSA"],
507
+ severity: "medium",
508
+ },
509
+ {
510
+ name: "github.com/decred/dcrd/dcrec/secp256k1/v4",
511
+ ecosystem: "go",
512
+ reason: "decred secp256k1 — classical ECDSA/ECDH on the secp256k1 curve (blockchain keys).",
513
+ algorithms: ["ECDSA", "ECDH"],
514
+ severity: "medium",
515
+ },
448
516
 
449
517
  // --- Maven (Java) ---
450
518
  {
@@ -476,6 +544,21 @@ export const vulnerableDependencies: VulnerableDependency[] = [
476
544
  severity: "medium",
477
545
  hndl: false,
478
546
  },
547
+ {
548
+ name: "nimbus-jose-jwt",
549
+ ecosystem: "maven",
550
+ reason: "Nimbus JOSE+JWT — classical RS*/PS*/ES* JWS and RSA/ECDH-ES JWE.",
551
+ algorithms: ["RSA", "ECDSA", "ECDH"],
552
+ severity: "medium",
553
+ },
554
+ {
555
+ name: "jjwt-api",
556
+ ecosystem: "maven",
557
+ reason: "JJWT (io.jsonwebtoken) — classical RS*/ES* JWT signing.",
558
+ algorithms: ["RSA", "ECDSA"],
559
+ severity: "medium",
560
+ hndl: false,
561
+ },
479
562
 
480
563
  // --- RubyGems ---
481
564
  {
@@ -486,6 +569,14 @@ export const vulnerableDependencies: VulnerableDependency[] = [
486
569
  severity: "medium",
487
570
  hndl: false,
488
571
  },
572
+ {
573
+ name: "net-ssh",
574
+ ecosystem: "rubygems",
575
+ reason:
576
+ "Ruby SSH client — classical host/user keys (RSA/ECDSA/Ed25519) and ECDH/DH key exchange.",
577
+ algorithms: ["RSA", "ECDSA", "ECDH"],
578
+ severity: "medium",
579
+ },
489
580
  {
490
581
  name: "rbnacl",
491
582
  ecosystem: "rubygems",
@@ -500,13 +591,46 @@ export const vulnerableDependencies: VulnerableDependency[] = [
500
591
  algorithms: ["EdDSA"],
501
592
  severity: "low",
502
593
  },
594
+
595
+ // --- NuGet (.NET) ---
596
+ {
597
+ name: "BouncyCastle.Cryptography",
598
+ ecosystem: "nuget",
599
+ reason: "BouncyCastle for .NET — full classical RSA/ECDSA/ECDH/DSA suite.",
600
+ algorithms: ["RSA", "ECDSA", "ECDH", "DSA"],
601
+ severity: "high",
602
+ },
603
+ {
604
+ name: "Portable.BouncyCastle",
605
+ ecosystem: "nuget",
606
+ reason: "Portable BouncyCastle for .NET — classical RSA/ECDSA/ECDH/DSA.",
607
+ algorithms: ["RSA", "ECDSA", "ECDH", "DSA"],
608
+ severity: "high",
609
+ },
610
+ {
611
+ name: "System.IdentityModel.Tokens.Jwt",
612
+ ecosystem: "nuget",
613
+ reason: "Microsoft JWT handler — classical RS*/ES* (RSA/ECDSA) signatures.",
614
+ algorithms: ["RSA", "ECDSA"],
615
+ severity: "medium",
616
+ hndl: false,
617
+ },
618
+ {
619
+ name: "Microsoft.IdentityModel.Tokens",
620
+ ecosystem: "nuget",
621
+ reason: "Microsoft IdentityModel token crypto — classical RSA/ECDSA keys.",
622
+ algorithms: ["RSA", "ECDSA"],
623
+ severity: "medium",
624
+ hndl: false,
625
+ },
503
626
  ];
504
627
 
505
628
  /**
506
629
  * Normalise a package name for matching within its ecosystem. PyPI is
507
630
  * case-insensitive and folds runs of `-_.` to a single `-` (PEP 503); cargo /
508
- * maven / rubygems are effectively lower-case; npm and go module paths are
509
- * matched verbatim (npm scopes and go paths are case-sensitive).
631
+ * maven / rubygems / nuget are effectively lower-case (NuGet ids are matched
632
+ * case-insensitively); npm and go module paths are matched verbatim (npm scopes
633
+ * and go paths are case-sensitive).
510
634
  */
511
635
  function normalizeName(ecosystem: DependencyEcosystem, name: string): string {
512
636
  const n = name.trim();
@@ -592,6 +716,8 @@ export function manifestEcosystem(file: string): DependencyEcosystem | null {
592
716
  if (base === "go.mod") return "go";
593
717
  if (base === "pom.xml" || base === "build.gradle" || base === "build.gradle.kts") return "maven";
594
718
  if (base === "gemfile" || base.endsWith(".gemspec")) return "rubygems";
719
+ if (base === "packages.config" || base === "directory.packages.props" || base.endsWith(".csproj"))
720
+ return "nuget";
595
721
  return null;
596
722
  }
597
723
 
@@ -657,6 +783,20 @@ function candidateNames(ecosystem: DependencyEcosystem, content: string): string
657
783
  }
658
784
  break;
659
785
  }
786
+ case "nuget": {
787
+ // NuGet manifests are XML. `.csproj` / `Directory.Packages.props` declare
788
+ // `<PackageReference Include="Name" … />`; `packages.config` uses
789
+ // `<package id="Name" … />`. Pull the Include= / id= attribute value from
790
+ // each. The `[^>]` guard keeps every match inside a single tag, so the
791
+ // scan is linear (no nested quantifiers → no catastrophic backtracking).
792
+ for (const m of content.matchAll(/<PackageReference\b[^>]*\bInclude\s*=\s*"([^"]+)"/gi)) {
793
+ names.push(m[1]);
794
+ }
795
+ for (const m of content.matchAll(/<package\b[^>]*\bid\s*=\s*"([^"]+)"/gi)) {
796
+ names.push(m[1]);
797
+ }
798
+ break;
799
+ }
660
800
  case "npm":
661
801
  break; // npm uses the JSON path, not this extractor.
662
802
  }
@@ -223,7 +223,10 @@ export const PYTHON_EXTENSIONS: readonly string[] = [".py", ".pyi", ".pyw"];
223
223
  export const GO_EXTENSIONS: readonly string[] = [".go"];
224
224
 
225
225
  /** Java / Kotlin source extensions handled by the JCA detector. */
226
- export const JAVA_EXTENSIONS: readonly string[] = [".java", ".kt", ".kts"];
226
+ // The JVM detector also covers Kotlin (`.kt`/`.kts`) and Scala (`.scala`/`.sc`):
227
+ // all three compile against the same JCA (`KeyPairGenerator`, `Signature`,
228
+ // `KeyAgreement`) and BouncyCastle APIs the Java rules match.
229
+ export const JAVA_EXTENSIONS: readonly string[] = [".java", ".kt", ".kts", ".scala", ".sc"];
227
230
 
228
231
  /** C# source extensions handled by the .NET detector. */
229
232
  export const CSHARP_EXTENSIONS: readonly string[] = [".cs"];
@@ -234,17 +237,52 @@ export const RUST_EXTENSIONS: readonly string[] = [".rs"];
234
237
  /** Ruby source extensions handled by the Ruby detector. */
235
238
  export const RUBY_EXTENSIONS: readonly string[] = [".rb"];
236
239
 
240
+ /** Elixir source extensions handled by the Elixir detector. */
241
+ export const ELIXIR_EXTENSIONS: readonly string[] = [".ex", ".exs"];
242
+
243
+ /** PHP source extensions handled by the PHP detector. */
244
+ export const PHP_EXTENSIONS: readonly string[] = [".php", ".phtml", ".php3", ".php4", ".php5"];
245
+
237
246
  /** C / C++ source extensions handled by the OpenSSL detector. */
238
247
  export const C_EXTENSIONS: readonly string[] = [".c", ".h", ".cc", ".cpp", ".cxx", ".hpp", ".hh"];
239
248
 
249
+ /**
250
+ * Prose/documentation extensions. The language-agnostic *token* detectors (SSH
251
+ * public keys, TLS cipher suites, certificate signature algorithms) must not run
252
+ * on these: a changelog or README that mentions `ssh-rsa` or `ECDHE-RSA` in a
253
+ * sentence is prose, not crypto config. (PEM/`-----BEGIN` material stays in scope
254
+ * everywhere, so a key pasted into docs is still caught.)
255
+ */
256
+ export const DOC_EXTENSIONS: readonly string[] = [
257
+ ".md",
258
+ ".markdown",
259
+ ".mdown",
260
+ ".mkd",
261
+ ".rst",
262
+ ".adoc",
263
+ ".asciidoc",
264
+ ".textile",
265
+ ".org",
266
+ ".rdoc",
267
+ ".pod",
268
+ ];
269
+
240
270
  /**
241
271
  * File-literal surfaces where a JWT/JOSE algorithm string (`"RS256"`, `"ES256"`)
242
272
  * is the same evidence regardless of language. Used to un-gate the JWT detector
243
- * from JS-only. Kept to JS/TS + Python for now (both quote the alg token, so the
244
- * regex stays precise); YAML/JSON config carry unquoted tokens and higher FP
245
- * risk, so they wait for a config-aware pass.
273
+ * from JS-only. Covers the languages whose JWT libraries pass the alg as a quoted
274
+ * token JS/TS, Python, Go (`jwt.GetSigningMethod("RS256")`) and Ruby
275
+ * (`JWT.encode(payload, key, 'RS256')`) — so the regex stays precise (`HS*` HMAC
276
+ * tokens are excluded by `RE_JWT_ALG`). Java/C# pass the alg as an *identifier*
277
+ * (`SignatureAlgorithm.RS256`), which needs its own pattern — a later pass.
278
+ * YAML/JSON config carry unquoted tokens and higher FP risk, so they wait too.
246
279
  */
247
- export const JWT_HOST_EXTENSIONS: readonly string[] = [...JS_TS_EXTENSIONS, ...PYTHON_EXTENSIONS];
280
+ export const JWT_HOST_EXTENSIONS: readonly string[] = [
281
+ ...JS_TS_EXTENSIONS,
282
+ ...PYTHON_EXTENSIONS,
283
+ ...GO_EXTENSIONS,
284
+ ...RUBY_EXTENSIONS,
285
+ ];
248
286
 
249
287
  /**
250
288
  * Extensions the scanner can actually analyze for inline crypto usage today
@@ -262,6 +300,8 @@ export const ANALYZABLE_SOURCE_EXTENSIONS: readonly string[] = [
262
300
  ...CSHARP_EXTENSIONS,
263
301
  ...RUST_EXTENSIONS,
264
302
  ...RUBY_EXTENSIONS,
303
+ ...PHP_EXTENSIONS,
304
+ ...ELIXIR_EXTENSIONS,
265
305
  ...C_EXTENSIONS,
266
306
  ];
267
307
 
@@ -270,7 +310,8 @@ export const ANALYZABLE_SOURCE_EXTENSIONS: readonly string[] = [
270
310
  * crypto, shown in coverage output. Kept next to {@link
271
311
  * ANALYZABLE_SOURCE_EXTENSIONS} so a new language pack updates one place.
272
312
  */
273
- export const ANALYZABLE_LANGUAGES_LABEL = "JS/TS, Python, Go, Java, C#, Rust, Ruby, C/C++";
313
+ export const ANALYZABLE_LANGUAGES_LABEL =
314
+ "JS/TS, Python, Go, Java/Kotlin/Scala, C#, Rust, Ruby, PHP, Elixir, C/C++";
274
315
 
275
316
  /** True when a path is in a source language the scanner can analyze for crypto. */
276
317
  export function isAnalyzableSource(filePath: string): boolean {