@quantakrypto/core 0.4.2 → 0.4.3

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 (132) 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.js.map +1 -1
  7. package/dist/changed.js.map +1 -1
  8. package/dist/codemods/config-toggle.js.map +1 -1
  9. package/dist/codemods/registry.js.map +1 -1
  10. package/dist/comments.d.ts +26 -0
  11. package/dist/comments.d.ts.map +1 -1
  12. package/dist/comments.js +141 -1
  13. package/dist/comments.js.map +1 -1
  14. package/dist/config.js.map +1 -1
  15. package/dist/cwe.js.map +1 -1
  16. package/dist/dependencies.d.ts +3 -2
  17. package/dist/dependencies.d.ts.map +1 -1
  18. package/dist/dependencies.js +138 -2
  19. package/dist/dependencies.js.map +1 -1
  20. package/dist/detect-utils.d.ts +14 -3
  21. package/dist/detect-utils.d.ts.map +1 -1
  22. package/dist/detect-utils.js +32 -4
  23. package/dist/detect-utils.js.map +1 -1
  24. package/dist/detectors/c.d.ts.map +1 -1
  25. package/dist/detectors/c.js +190 -2
  26. package/dist/detectors/c.js.map +1 -1
  27. package/dist/detectors/csharp.d.ts.map +1 -1
  28. package/dist/detectors/csharp.js +141 -3
  29. package/dist/detectors/csharp.js.map +1 -1
  30. package/dist/detectors/go.d.ts +5 -3
  31. package/dist/detectors/go.d.ts.map +1 -1
  32. package/dist/detectors/go.js +187 -3
  33. package/dist/detectors/go.js.map +1 -1
  34. package/dist/detectors/java.d.ts.map +1 -1
  35. package/dist/detectors/java.js +168 -3
  36. package/dist/detectors/java.js.map +1 -1
  37. package/dist/detectors/pem.d.ts.map +1 -1
  38. package/dist/detectors/pem.js +49 -1
  39. package/dist/detectors/pem.js.map +1 -1
  40. package/dist/detectors/python.d.ts.map +1 -1
  41. package/dist/detectors/python.js +74 -3
  42. package/dist/detectors/python.js.map +1 -1
  43. package/dist/detectors/ruby.d.ts +9 -5
  44. package/dist/detectors/ruby.d.ts.map +1 -1
  45. package/dist/detectors/ruby.js +122 -2
  46. package/dist/detectors/ruby.js.map +1 -1
  47. package/dist/detectors/rust.d.ts +8 -3
  48. package/dist/detectors/rust.d.ts.map +1 -1
  49. package/dist/detectors/rust.js +185 -3
  50. package/dist/detectors/rust.js.map +1 -1
  51. package/dist/detectors/source.d.ts.map +1 -1
  52. package/dist/detectors/source.js +117 -7
  53. package/dist/detectors/source.js.map +1 -1
  54. package/dist/detectors/stateful-hbs.d.ts +22 -0
  55. package/dist/detectors/stateful-hbs.d.ts.map +1 -0
  56. package/dist/detectors/stateful-hbs.js +139 -0
  57. package/dist/detectors/stateful-hbs.js.map +1 -0
  58. package/dist/errors.js.map +1 -1
  59. package/dist/evidence.d.ts +48 -0
  60. package/dist/evidence.d.ts.map +1 -0
  61. package/dist/evidence.js +76 -0
  62. package/dist/evidence.js.map +1 -0
  63. package/dist/index.d.ts +4 -2
  64. package/dist/index.d.ts.map +1 -1
  65. package/dist/index.js +4 -2
  66. package/dist/index.js.map +1 -1
  67. package/dist/inventory.d.ts +2 -0
  68. package/dist/inventory.d.ts.map +1 -1
  69. package/dist/inventory.js +27 -1
  70. package/dist/inventory.js.map +1 -1
  71. package/dist/parallel.js.map +1 -1
  72. package/dist/patch-policy.js.map +1 -1
  73. package/dist/redact.d.ts.map +1 -1
  74. package/dist/redact.js +39 -0
  75. package/dist/redact.js.map +1 -1
  76. package/dist/registry.d.ts +2 -2
  77. package/dist/registry.d.ts.map +1 -1
  78. package/dist/registry.js +4 -2
  79. package/dist/registry.js.map +1 -1
  80. package/dist/remediate-pipeline.d.ts +3 -0
  81. package/dist/remediate-pipeline.d.ts.map +1 -1
  82. package/dist/remediate-pipeline.js +50 -0
  83. package/dist/remediate-pipeline.js.map +1 -1
  84. package/dist/remediate-request.js.map +1 -1
  85. package/dist/remediation.d.ts +9 -3
  86. package/dist/remediation.d.ts.map +1 -1
  87. package/dist/remediation.js +17 -5
  88. package/dist/remediation.js.map +1 -1
  89. package/dist/report.d.ts +9 -0
  90. package/dist/report.d.ts.map +1 -1
  91. package/dist/report.js +31 -0
  92. package/dist/report.js.map +1 -1
  93. package/dist/scan-worker.js.map +1 -1
  94. package/dist/scan.d.ts.map +1 -1
  95. package/dist/scan.js +8 -1
  96. package/dist/scan.js.map +1 -1
  97. package/dist/severity.js.map +1 -1
  98. package/dist/triage.js.map +1 -1
  99. package/dist/types.d.ts +1 -1
  100. package/dist/types.d.ts.map +1 -1
  101. package/dist/types.js.map +1 -1
  102. package/dist/verify.js.map +1 -1
  103. package/dist/version.d.ts +1 -1
  104. package/dist/version.js +1 -1
  105. package/dist/version.js.map +1 -1
  106. package/dist/walk.js.map +1 -1
  107. package/dist/worktree.js.map +1 -1
  108. package/package.json +1 -1
  109. package/src/comments.ts +140 -1
  110. package/src/dependencies.ts +143 -4
  111. package/src/detect-utils.ts +33 -4
  112. package/src/detectors/c.ts +202 -2
  113. package/src/detectors/csharp.ts +154 -3
  114. package/src/detectors/go.ts +209 -6
  115. package/src/detectors/java.ts +189 -3
  116. package/src/detectors/pem.ts +53 -1
  117. package/src/detectors/python.ts +82 -3
  118. package/src/detectors/ruby.ts +138 -7
  119. package/src/detectors/rust.ts +211 -7
  120. package/src/detectors/source.ts +149 -6
  121. package/src/detectors/stateful-hbs.ts +177 -0
  122. package/src/evidence.ts +124 -0
  123. package/src/index.ts +5 -1
  124. package/src/inventory.ts +31 -1
  125. package/src/redact.ts +41 -0
  126. package/src/registry.ts +4 -2
  127. package/src/remediate-pipeline.ts +55 -0
  128. package/src/remediation.ts +23 -8
  129. package/src/report.ts +41 -2
  130. package/src/scan.ts +13 -1
  131. package/src/types.ts +1 -1
  132. package/src/version.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"source.js","sourceRoot":"","sources":["../../src/detectors/source.ts"],"names":[],"mappings":"AA6BA,OAAO,EACL,gBAA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Y,CAAC,CAAC,EAAE,cAAc,CAAC;IAClD,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE;QACtB,MAAM,QAAQ,GAAc,EAAE,CAAC;QAC/B,SAAS,CAAC,oBAAoB,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YAC7C,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YACjB,MAAM,SAAS,GAAyB,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;YAC7E,QAAQ,CAAC,IAAI,CACX,eAAe,CACb,sBAAsB,EACtB,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAC3D;gBACE,SAAS;gBACT,OAAO,EAAE,qCAAqC,GAAG,OAAO,SAAS,yCAAyC;aAC3G,CACF,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF,CAAC;AAEF,0DAA0D;AAC1D,MAAM,CAAC,MAAM,eAAe,GAAe;IACzC,kBAAkB;IAClB,iBAAiB;IACjB,eAAe;IACf,WAAW;IACX,WAAW;IACX,eAAe;IACf,uBAAuB;CACxB,CAAC","sourcesContent":["/**\n * Source-code detectors for classical, non-quantum-safe asymmetric cryptography\n * in JavaScript / TypeScript. Each detector is pure and stateless: it declares\n * which files it applies to, the catalog of rules it can emit (`rules`), and\n * returns zero or more Findings for a file's contents.\n *\n * Rule metadata (title / severity / category / remediation / …) lives ONCE in\n * the per-detector `RuleMeta` declarations below, not inline in `detect()`.\n * `detect()` builds findings from those declarations via `findingFromRule`,\n * overriding only the fields that genuinely vary per match (e.g. the concrete\n * algorithm family of a `generateKeyPair('ec')` call). The declarations are the\n * catalog surfaced by the registry, SARIF `rules[]`, and the MCP resolver.\n *\n * The detection strategy is deliberately lexical (regex over source text). This\n * is robust to bundling and partial files and keeps the package dependency-free.\n * Confidence is set per-pattern to reflect how specific the match is.\n *\n * All per-file regexes are precompiled at module scope (not re-created per\n * file) — `eachMatch` clones a fresh stateful copy only when a regex lacks the\n * global flag, and these are all global, so they are reused safely.\n *\n * HNDL (harvest-now-decrypt-later) policy:\n * - confidentiality primitives (key exchange / KEM: ECDH, DH, RSA-OAEP) → hndl:true\n * - signatures (RSA-PSS, ECDSA, EdDSA, DSA, JWT alg) → hndl:false, but still high\n * severity because a quantum attacker can forge them.\n * - EC keygen is ambiguous (an 'ec' key feeds BOTH ECDSA and ECDH); it is\n * classified conservatively as key-exchange-capable (hndl:true).\n */\nimport type { Detector, Finding, RuleMeta } from \"../types.js\";\nimport {\n JS_TS_EXTENSIONS,\n DOC_EXTENSIONS,\n JWT_HOST_EXTENSIONS,\n eachMatch,\n findingFromRule,\n hasExtension,\n nearSortedCall,\n} from \"../detect-utils.js\";\nimport { CWE_BROKEN_CRYPTO, CWE_CERT_VALIDATION, CWE_WEAK_STRENGTH } from \"../cwe.js\";\n\n/* -------------------------------------------------------------------------- */\n/* Precompiled regexes (module scope — never recreated per file) */\n/* -------------------------------------------------------------------------- */\n\n// `rsa-pss` is listed before `rsa` so the alternation consumes the full token\n// (ordered alternation would otherwise match `rsa` and reject the `-pss` tail).\nconst RE_GENERATE_KEYPAIR =\n /generateKeyPair(?:Sync)?\\s*\\(\\s*['\"`](rsa-pss|rsa|ec|dsa|dh|x25519|x448|ed25519|ed448)['\"`]/g;\nconst RE_CREATE_SIGN_VERIFY = /create(?:Sign|Verify)\\s*\\(/g;\n// One-shot crypto.sign/verify(algorithm, data, key). A LOOKBEHIND (not a\n// consumed char) anchors it so it doesn't fire inside identifiers like `assign(`\n// or `createSign(` (handled by the dedicated createSign/createVerify rule) —\n// consuming the preceding char used to push the match onto the previous line,\n// corrupting the reported line/snippet and SARIF/baseline fingerprints. The\n// first argument is either a quoted digest-algorithm string (RSA/ECDSA) or\n// `null` — Node's EdDSA one-shot form is `crypto.sign(null, data, edKey)`.\nconst RE_ONESHOT_SIGN_VERIFY =\n /(?<![.\\w])(?:crypto\\.)?(sign|verify)\\s*\\(\\s*(?:['\"`][\\w.-]+['\"`]|null)\\s*,/g;\nconst RE_CREATE_DH = /createDiffieHellman(?:Group)?\\s*\\(/g;\nconst RE_GET_DH = /getDiffieHellman\\s*\\(\\s*['\"`](modp\\d+)['\"`]\\s*\\)/g;\nconst RE_CREATE_ECDH = /createECDH\\s*\\(/g;\nconst RE_RSA_ENCRYPT = /(?:crypto\\.)?(?:publicEncrypt|privateDecrypt)\\s*\\(/g;\nconst RE_DH_KEYOBJECT = /(?:crypto\\.)?diffieHellman\\s*\\(\\s*\\{/g;\n\n// WebCrypto. Includes the newer curve algorithms (Ed25519/Ed448 signatures,\n// X25519/X448 key agreement) shipping in modern SubtleCrypto implementations.\nconst RE_WEBCRYPTO_ALGO =\n /\\b(RSA-OAEP|RSA-PSS|RSASSA-PKCS1-v1_5|ECDH|ECDSA|Ed25519|Ed448|X25519|X448)\\b/gi;\nconst RE_SUBTLE_CALL =\n /subtle\\s*\\.\\s*(generateKey|importKey|exportKey|deriveKey|deriveBits|sign|verify|encrypt|decrypt|wrapKey|unwrapKey)\\s*\\(/g;\n\n// Libraries.\nconst RE_FORGE_RSA = /pki\\.rsa\\.generateKeyPair\\s*\\(/g;\nconst RE_FORGE_ED25519 = /forge\\.ed25519\\b/g;\n// Require a curve-like first argument so `new EC(\"request-scope\")` (a non-crypto\n// `EC` class) is not flagged; the elliptic library is always constructed with a\n// named curve (`new EC('secp256k1')`, `new EC('p256')`, …).\nconst RE_ELLIPTIC_EC =\n /new\\s+(?:elliptic\\.)?ec\\s*\\(\\s*['\"`](?:sec[pt]|prime|nistp|curve|ed25519|ed448|brainpool|p-?(?:192|224|256|384|521)|x25519|x448)/gi;\nconst RE_JSRSASIGN_KEYGEN = /KEYUTIL\\.generateKeypair\\s*\\(/g;\nconst RE_JSRSASIGN_SIGN = /KJUR\\.crypto\\.(?:Signature|ECDSA)\\b/g;\nconst RE_NODE_RSA = /new\\s+NodeRSA\\s*\\(/g;\n// secp256k1 — direct @noble/secp256k1 / secp256k1-style API usage in source.\nconst RE_SECP256K1 =\n /\\b(?:secp(?:256k1)?|secp)\\s*\\.\\s*(?:sign|verify|getPublicKey|getSharedSecret|ecdh|recoverPublicKey)\\s*\\(/g;\n\n// JWT/JOSE.\nconst RE_JWT_ALG = /['\"`](RS(?:256|384|512)|PS(?:256|384|512)|ES(?:256|384|512|256K)|EdDSA)['\"`]/g;\n// JOSE ECDH-ES key agreement (HNDL) and COSE algorithm identifiers.\nconst RE_JOSE_ECDH = /['\"`](ECDH-ES(?:\\+A(?:128|192|256)KW)?)['\"`]/g;\n\n// TLS config.\nconst RE_TLS_LEGACY_VERSION =\n /(?:minVersion|maxVersion)\\s*:\\s*['\"`]TLSv1(?:\\.1)?['\"`]|secureProtocol\\s*:\\s*['\"`]TLSv1(?:_1)?_method['\"`]/g;\nconst RE_TLS_REJECT = /rejectUnauthorized\\s*:\\s*false/g;\n// Hardened cipher regex: bounded spans (no unbounded `[^'\"`]*` straddling the\n// alternation), single-quote-style anchoring removed in favour of {0,256} bounds\n// so worst-case backtracking is linear in the bound, not the file (P0-6).\n// The `(?<![!-])` lookbehind skips OpenSSL EXCLUSION syntax — `!MD5` / `-RC4`\n// DISABLE those ciphers, so a hardened list like `...:!aNULL:!MD5:!RC4` must not\n// be flagged as weak (audit: crypto #7). A genuinely-enabled `RC4` still matches.\nconst RE_TLS_WEAK_CIPHER =\n /ciphers\\s*:\\s*['\"`][^'\"`\\n]{0,256}?\\b(?<![!-])(RC4|DES|3DES|MD5|NULL|EXPORT|aNULL|eNULL)\\b[^'\"`\\n]{0,256}?['\"`]/gi;\n\n/* -------------------------------------------------------------------------- */\n/* Node.js `crypto` module */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Rule catalog for the Node `crypto` detector. `node-crypto-keygen` and\n * `node-crypto-dh-modp` refine some fields per match; the rest emit findings\n * straight from these declarations.\n */\nconst RULE_NODE_KEYGEN: RuleMeta = {\n id: \"node-crypto-keygen\",\n title: \"Classical key generation\",\n description: \"crypto.generateKeyPair(Sync)('rsa'|'ec'|'dsa'|'dh'|…)\",\n category: \"key-exchange\",\n severity: \"high\",\n confidence: \"high\",\n algorithm: \"unknown\",\n hndl: true,\n cwe: CWE_BROKEN_CRYPTO,\n message: \"Generates a classical asymmetric key pair, which is not quantum-safe.\",\n};\nconst RULE_NODE_SIGN: RuleMeta = {\n id: \"node-crypto-sign\",\n title: \"Classical signature (createSign/createVerify)\",\n description: \"crypto.createSign / crypto.createVerify\",\n category: \"signature\",\n severity: \"high\",\n confidence: \"medium\",\n algorithm: \"unknown\",\n hndl: false,\n cwe: CWE_BROKEN_CRYPTO,\n message:\n \"Uses createSign/createVerify, typically RSA, ECDSA or DSA — all forgeable by a quantum attacker.\",\n remediation: \"ML-DSA-65 (FIPS 204) or SLH-DSA (FIPS 205)\",\n};\nconst RULE_NODE_SIGN_ONESHOT: RuleMeta = {\n id: \"node-crypto-sign-oneshot\",\n title: \"Classical one-shot signature (crypto.sign/verify)\",\n description: \"one-shot crypto.sign / crypto.verify (Node ≥ 12)\",\n category: \"signature\",\n severity: \"high\",\n confidence: \"medium\",\n algorithm: \"unknown\",\n hndl: false,\n cwe: CWE_BROKEN_CRYPTO,\n message:\n \"Uses the one-shot crypto.sign/crypto.verify API, typically RSA/ECDSA/EdDSA — forgeable by a quantum attacker.\",\n remediation: \"ML-DSA-65 (FIPS 204) or SLH-DSA (FIPS 205)\",\n};\nconst RULE_NODE_DH: RuleMeta = {\n id: \"node-crypto-dh\",\n title: \"Diffie-Hellman key exchange\",\n description: \"crypto.createDiffieHellman(Group)\",\n category: \"key-exchange\",\n severity: \"high\",\n confidence: \"high\",\n algorithm: \"DH\",\n hndl: true,\n cwe: CWE_BROKEN_CRYPTO,\n message: \"Finite-field Diffie-Hellman is broken by Shor's algorithm (harvest-now-decrypt-later).\",\n};\nconst RULE_NODE_DH_MODP: RuleMeta = {\n id: \"node-crypto-dh-modp\",\n title: \"Diffie-Hellman MODP group\",\n description: \"crypto.getDiffieHellman('modpN')\",\n category: \"key-exchange\",\n severity: \"high\",\n confidence: \"high\",\n algorithm: \"DH\",\n hndl: true,\n cwe: CWE_BROKEN_CRYPTO,\n message:\n \"Named finite-field DH MODP group is broken by Shor's algorithm (harvest-now-decrypt-later).\",\n};\nconst RULE_NODE_ECDH: RuleMeta = {\n id: \"node-crypto-ecdh\",\n title: \"ECDH key exchange\",\n description: \"crypto.createECDH\",\n category: \"key-exchange\",\n severity: \"high\",\n confidence: \"high\",\n algorithm: \"ECDH\",\n hndl: true,\n cwe: CWE_BROKEN_CRYPTO,\n message:\n \"Elliptic-curve Diffie-Hellman is broken by Shor's algorithm (harvest-now-decrypt-later).\",\n};\nconst RULE_NODE_RSA_ENCRYPT: RuleMeta = {\n id: \"node-crypto-rsa-encrypt\",\n title: \"RSA public-key encryption\",\n description: \"crypto.publicEncrypt / crypto.privateDecrypt\",\n category: \"kem\",\n severity: \"high\",\n confidence: \"high\",\n algorithm: \"RSA\",\n hndl: true,\n cwe: CWE_BROKEN_CRYPTO,\n message:\n \"RSA public-key encryption is broken by Shor's algorithm and exposed to harvest-now-decrypt-later.\",\n};\nconst RULE_NODE_DH_KEYOBJECT: RuleMeta = {\n id: \"node-crypto-dh-keyobject\",\n title: \"Diffie-Hellman (KeyObject) key exchange\",\n description: \"crypto.diffieHellman({ privateKey, publicKey })\",\n category: \"key-exchange\",\n severity: \"high\",\n confidence: \"high\",\n algorithm: \"ECDH\",\n hndl: true,\n cwe: CWE_BROKEN_CRYPTO,\n message:\n \"crypto.diffieHellman() performs a classical (EC)DH agreement (harvest-now-decrypt-later).\",\n};\n\n/** Detects classical asymmetric usage from Node's built-in `crypto` module. */\nconst nodeCryptoDetector: Detector = {\n id: \"node-crypto\",\n description: \"Classical asymmetric crypto via the Node.js `crypto` module\",\n scope: \"source\",\n language: \"js\",\n rules: [\n RULE_NODE_KEYGEN,\n RULE_NODE_SIGN,\n RULE_NODE_SIGN_ONESHOT,\n RULE_NODE_DH,\n RULE_NODE_DH_MODP,\n RULE_NODE_ECDH,\n RULE_NODE_RSA_ENCRYPT,\n RULE_NODE_DH_KEYOBJECT,\n ],\n appliesTo: (f) => hasExtension(f, JS_TS_EXTENSIONS),\n detect({ file, content }): Finding[] {\n const findings: Finding[] = [];\n\n // generateKeyPair(Sync)('rsa' | 'ec' | 'dsa' | 'dh' | 'x25519' | 'ed25519', ...)\n eachMatch(RE_GENERATE_KEYPAIR, content, (m) => {\n const type = m[1].toLowerCase();\n const map: Record<\n string,\n {\n algo: Finding[\"algorithm\"];\n cat: Finding[\"category\"];\n sev: Finding[\"severity\"];\n hndl: boolean;\n label: string;\n message?: string;\n remediation?: string;\n }\n > = {\n rsa: { algo: \"RSA\", cat: \"kem\", sev: \"high\", hndl: true, label: \"RSA\" },\n // RSA-PSS is signature-only, so classify it as a (forgeable) signature\n // rather than a KEM — no HNDL confidentiality exposure.\n \"rsa-pss\": {\n algo: \"RSA\",\n cat: \"signature\",\n sev: \"high\",\n hndl: false,\n label: \"RSA-PSS\",\n message:\n \"Generates a classical RSA-PSS signing key, which is forgeable by a quantum attacker.\",\n remediation: \"ML-DSA-65 (FIPS 204) or SLH-DSA (FIPS 205)\",\n },\n // EC keys feed BOTH ECDSA (sign) and ECDH (key agreement). ECDH is\n // HNDL-exposed, so classify conservatively as key-exchange-capable and\n // surface both concerns rather than asserting signature-only (P0-4).\n ec: {\n algo: \"ECDH\",\n cat: \"key-exchange\",\n sev: \"high\",\n hndl: true,\n label: \"EC (ECDSA/ECDH)\",\n message:\n \"Generates a classical EC key pair. EC keys feed BOTH ECDSA signatures \" +\n \"and ECDH key agreement; the ECDH path is harvest-now-decrypt-later exposed.\",\n remediation:\n \"For key agreement: hybrid X25519MLKEM768 (ML-KEM-768). For signatures: ML-DSA-65 (FIPS 204).\",\n },\n dsa: { algo: \"DSA\", cat: \"signature\", sev: \"high\", hndl: false, label: \"DSA\" },\n dh: { algo: \"DH\", cat: \"key-exchange\", sev: \"high\", hndl: true, label: \"Diffie-Hellman\" },\n x25519: { algo: \"X25519\", cat: \"key-exchange\", sev: \"medium\", hndl: true, label: \"X25519\" },\n x448: { algo: \"X448\", cat: \"key-exchange\", sev: \"medium\", hndl: true, label: \"X448\" },\n ed25519: { algo: \"EdDSA\", cat: \"signature\", sev: \"low\", hndl: false, label: \"Ed25519\" },\n ed448: { algo: \"EdDSA\", cat: \"signature\", sev: \"low\", hndl: false, label: \"Ed448\" },\n };\n const info = map[type];\n findings.push(\n findingFromRule(\n RULE_NODE_KEYGEN,\n { file, content, index: m.index, matchLength: m[0].length },\n {\n title: `${info.label} key generation`,\n category: info.cat,\n severity: info.sev,\n algorithm: info.algo,\n hndl: info.hndl,\n message:\n info.message ??\n `Generates a classical ${info.label} key pair, which is not quantum-safe.`,\n ...(info.remediation ? { remediation: info.remediation } : {}),\n },\n ),\n );\n });\n\n // createSign / createVerify — RSA / ECDSA / DSA signatures.\n eachMatch(RE_CREATE_SIGN_VERIFY, content, (m) => {\n findings.push(\n findingFromRule(RULE_NODE_SIGN, {\n file,\n content,\n index: m.index,\n matchLength: m[0].length,\n }),\n );\n });\n\n // One-shot crypto.sign(algorithm, data, key) / crypto.verify(...) (Node ≥ 12).\n eachMatch(RE_ONESHOT_SIGN_VERIFY, content, (m) => {\n findings.push(\n findingFromRule(RULE_NODE_SIGN_ONESHOT, {\n file,\n content,\n index: m.index,\n matchLength: m[0].length,\n }),\n );\n });\n\n // createDiffieHellman / createDiffieHellmanGroup — finite-field DH key exchange.\n eachMatch(RE_CREATE_DH, content, (m) => {\n findings.push(\n findingFromRule(RULE_NODE_DH, { file, content, index: m.index, matchLength: m[0].length }),\n );\n });\n\n // getDiffieHellman('modpN') — named built-in finite-field MODP groups.\n eachMatch(RE_GET_DH, content, (m) => {\n findings.push(\n findingFromRule(\n RULE_NODE_DH_MODP,\n { file, content, index: m.index, matchLength: m[0].length },\n {\n title: `Diffie-Hellman MODP group (${m[1]})`,\n message: `Named finite-field DH MODP group \"${m[1]}\" is broken by Shor's algorithm (harvest-now-decrypt-later).`,\n },\n ),\n );\n });\n\n // createECDH — elliptic-curve Diffie-Hellman key exchange.\n eachMatch(RE_CREATE_ECDH, content, (m) => {\n findings.push(\n findingFromRule(RULE_NODE_ECDH, {\n file,\n content,\n index: m.index,\n matchLength: m[0].length,\n }),\n );\n });\n\n // publicEncrypt / privateDecrypt — RSA encryption (KEM-like confidentiality).\n eachMatch(RE_RSA_ENCRYPT, content, (m) => {\n findings.push(\n findingFromRule(RULE_NODE_RSA_ENCRYPT, {\n file,\n content,\n index: m.index,\n matchLength: m[0].length,\n }),\n );\n });\n\n // diffieHellman({ privateKey, publicKey }) — KeyObject-based DH/ECDH.\n eachMatch(RE_DH_KEYOBJECT, content, (m) => {\n findings.push(\n findingFromRule(RULE_NODE_DH_KEYOBJECT, {\n file,\n content,\n index: m.index,\n matchLength: m[0].length,\n }),\n );\n });\n\n return findings;\n },\n};\n\n/* -------------------------------------------------------------------------- */\n/* WebCrypto (SubtleCrypto) */\n/* -------------------------------------------------------------------------- */\n\nconst RULE_WEBCRYPTO: RuleMeta = {\n id: \"webcrypto-classical\",\n title: \"WebCrypto classical algorithm\",\n description: \"classical asymmetric algorithm passed to SubtleCrypto\",\n category: \"signature\",\n severity: \"high\",\n confidence: \"high\",\n algorithm: \"unknown\",\n hndl: false,\n cwe: CWE_BROKEN_CRYPTO,\n message: \"A classical asymmetric WebCrypto algorithm is used, which is not quantum-safe.\",\n};\n\n/**\n * Detects classical algorithms passed to WebCrypto's SubtleCrypto methods. The\n * algorithm name can appear as a bare string (\"RSA-OAEP\") or as\n * `{ name: \"ECDH\" }`; we scan both forms within a window after a subtle call.\n */\nconst webCryptoDetector: Detector = {\n id: \"webcrypto\",\n description: \"Classical asymmetric algorithms via WebCrypto SubtleCrypto\",\n scope: \"source\",\n language: \"js\",\n rules: [RULE_WEBCRYPTO],\n appliesTo: (f) => hasExtension(f, JS_TS_EXTENSIONS),\n detect({ file, content }): Finding[] {\n const findings: Finding[] = [];\n\n // Only consider names that appear near a subtle.* call to reduce noise.\n // callIndexes is collected in ascending order (regex scans left→right), so\n // proximity is resolved with a binary search instead of an O(M·C) scan.\n const callIndexes: number[] = [];\n eachMatch(RE_SUBTLE_CALL, content, (m) => callIndexes.push(m.index));\n if (callIndexes.length === 0) return findings;\n\n eachMatch(RE_WEBCRYPTO_ALGO, content, (m) => {\n if (!nearSortedCall(callIndexes, m.index, 400)) return;\n const name = m[1].toUpperCase();\n // Classify by algorithm: RSA-OAEP is KEM (HNDL); ECDH/X25519/X448 are key\n // agreement (HNDL); RSA-PSS/RSASSA/ECDSA/Ed25519/Ed448 are signatures.\n let algorithm: Finding[\"algorithm\"];\n let category: Finding[\"category\"];\n let hndl: boolean;\n let severity: Finding[\"severity\"] | undefined;\n if (name.startsWith(\"RSA\")) {\n algorithm = \"RSA\";\n const isKem = name === \"RSA-OAEP\";\n category = isKem ? \"kem\" : \"signature\";\n hndl = isKem;\n } else if (name === \"ECDH\") {\n algorithm = \"ECDH\";\n category = \"key-exchange\";\n hndl = true;\n } else if (name === \"X25519\" || name === \"X448\") {\n algorithm = name === \"X448\" ? \"X448\" : \"X25519\";\n category = \"key-exchange\";\n hndl = true;\n severity = \"low\"; // modern but classical\n } else if (name === \"ED25519\" || name === \"ED448\") {\n algorithm = \"EdDSA\";\n category = \"signature\";\n hndl = false;\n severity = \"low\";\n } else {\n algorithm = \"ECDSA\";\n category = \"signature\";\n hndl = false;\n }\n findings.push(\n findingFromRule(\n RULE_WEBCRYPTO,\n { file, content, index: m.index, matchLength: m[0].length },\n {\n title: `WebCrypto ${m[1]}`,\n category,\n algorithm,\n hndl,\n ...(severity ? { severity } : {}),\n message: `WebCrypto algorithm \"${m[1]}\" is classical asymmetric crypto and not quantum-safe.`,\n },\n ),\n );\n });\n\n return findings;\n },\n};\n\n/* -------------------------------------------------------------------------- */\n/* Popular crypto libraries */\n/* -------------------------------------------------------------------------- */\n\nconst RULE_FORGE_RSA: RuleMeta = {\n id: \"forge-rsa-keygen\",\n title: \"node-forge RSA key generation\",\n description: \"node-forge pki.rsa.generateKeyPair\",\n category: \"kem\",\n severity: \"high\",\n confidence: \"high\",\n algorithm: \"RSA\",\n hndl: true,\n cwe: CWE_BROKEN_CRYPTO,\n message: \"node-forge generates a classical RSA key pair, which is not quantum-safe.\",\n};\nconst RULE_FORGE_ED25519: RuleMeta = {\n id: \"forge-ed25519\",\n title: \"node-forge Ed25519 usage\",\n description: \"node-forge forge.ed25519.*\",\n category: \"signature\",\n severity: \"low\",\n confidence: \"high\",\n algorithm: \"EdDSA\",\n hndl: false,\n cwe: CWE_BROKEN_CRYPTO,\n message: \"node-forge Ed25519 is a modern but still classical signature scheme.\",\n};\nconst RULE_ELLIPTIC_EC: RuleMeta = {\n id: \"elliptic-ec\",\n title: \"elliptic curve instantiation\",\n description: \"the `elliptic` library — new EC(...)\",\n // `new EC(...)` is a dual-use curve context (ECDSA sign AND ECDH `key.derive()`).\n // Per this scanner's own EC-ambiguity policy, ambiguous EC is treated as\n // key-agreement-capable and HNDL-exposed (audit: crypto #8).\n category: \"key-exchange\",\n severity: \"high\",\n confidence: \"high\",\n algorithm: \"ECDH\",\n hndl: true,\n cwe: CWE_BROKEN_CRYPTO,\n message:\n \"The `elliptic` library implements classical ECDSA/ECDH, both broken by Shor's algorithm.\",\n};\nconst RULE_SECP256K1: RuleMeta = {\n id: \"secp256k1-usage\",\n title: \"secp256k1 ECDSA/ECDH usage\",\n description: \"direct @noble/secp256k1-style API usage\",\n category: \"signature\",\n severity: \"high\",\n confidence: \"medium\",\n algorithm: \"ECDSA\",\n hndl: false,\n cwe: CWE_BROKEN_CRYPTO,\n message:\n \"Direct secp256k1 usage (ECDSA signatures / ECDH agreement) is classical and broken by Shor's algorithm.\",\n remediation: \"ML-DSA-65 (FIPS 204) for signatures; hybrid X25519MLKEM768 for key agreement.\",\n};\nconst RULE_JSRSASIGN_KEYGEN: RuleMeta = {\n id: \"jsrsasign-keygen\",\n title: \"jsrsasign key generation\",\n description: \"jsrsasign KEYUTIL.generateKeypair\",\n // KEYUTIL.generateKeypair(\"RSA\"|\"EC\") makes keys usable for RSA-OAEP encryption\n // and ECDH — HNDL-exposed, like Node's generateKeyPair (audit: crypto #13).\n category: \"key-exchange\",\n severity: \"high\",\n confidence: \"high\",\n algorithm: \"unknown\",\n hndl: true,\n cwe: CWE_BROKEN_CRYPTO,\n message: \"jsrsasign generates classical RSA/EC key pairs, which are not quantum-safe.\",\n remediation: \"ML-KEM-768 (FIPS 203) / ML-DSA-65 (FIPS 204)\",\n};\nconst RULE_JSRSASIGN_SIGN: RuleMeta = {\n id: \"jsrsasign-sign\",\n title: \"jsrsasign signature\",\n description: \"jsrsasign KJUR.crypto.Signature / ECDSA\",\n category: \"signature\",\n severity: \"high\",\n confidence: \"high\",\n algorithm: \"unknown\",\n hndl: false,\n cwe: CWE_BROKEN_CRYPTO,\n message:\n \"jsrsasign signing uses classical RSA/ECDSA signatures, forgeable by a quantum attacker.\",\n remediation: \"ML-DSA-65 (FIPS 204)\",\n};\nconst RULE_NODE_RSA_LIB: RuleMeta = {\n id: \"node-rsa\",\n title: \"node-rsa key/usage\",\n description: \"the `node-rsa` library — new NodeRSA(...)\",\n category: \"kem\",\n severity: \"high\",\n confidence: \"high\",\n algorithm: \"RSA\",\n hndl: true,\n cwe: CWE_BROKEN_CRYPTO,\n message: \"node-rsa wraps classical RSA encryption/signing, which is not quantum-safe.\",\n};\n\n/** Detects classical crypto from popular npm libraries used in source. */\nconst libraryDetector: Detector = {\n id: \"crypto-libs\",\n description: \"Classical asymmetric crypto via node-forge, elliptic, jsrsasign, node-rsa\",\n scope: \"source\",\n language: \"js\",\n rules: [\n RULE_FORGE_RSA,\n RULE_FORGE_ED25519,\n RULE_ELLIPTIC_EC,\n RULE_SECP256K1,\n RULE_JSRSASIGN_KEYGEN,\n RULE_JSRSASIGN_SIGN,\n RULE_NODE_RSA_LIB,\n ],\n appliesTo: (f) => hasExtension(f, JS_TS_EXTENSIONS),\n detect({ file, content }): Finding[] {\n const findings: Finding[] = [];\n const add = (re: RegExp, rule: RuleMeta) =>\n eachMatch(re, content, (m) =>\n findings.push(\n findingFromRule(rule, { file, content, index: m.index, matchLength: m[0].length }),\n ),\n );\n\n add(RE_FORGE_RSA, RULE_FORGE_RSA); // node-forge: pki.rsa.generateKeyPair(...)\n add(RE_FORGE_ED25519, RULE_FORGE_ED25519); // node-forge: forge.ed25519.*\n add(RE_ELLIPTIC_EC, RULE_ELLIPTIC_EC); // elliptic: new EC('secp256k1')\n add(RE_SECP256K1, RULE_SECP256K1); // secp.sign / getPublicKey / getSharedSecret\n add(RE_JSRSASIGN_KEYGEN, RULE_JSRSASIGN_KEYGEN); // jsrsasign: KEYUTIL.generateKeypair(...)\n add(RE_JSRSASIGN_SIGN, RULE_JSRSASIGN_SIGN); // jsrsasign: KJUR.crypto.*\n add(RE_NODE_RSA, RULE_NODE_RSA_LIB); // node-rsa: new NodeRSA(...)\n\n return findings;\n },\n};\n\n/* -------------------------------------------------------------------------- */\n/* JWT / JOSE / COSE algorithm strings */\n/* -------------------------------------------------------------------------- */\n\n// JOSE RSA key-transport algorithms (JWE `alg`): quoted RSA-OAEP / RSA-OAEP-256\n// /384/512 / RSA1_5. Classical RSA *encryption* (key transport) — distinct from\n// the RS*/PS* *signature* tokens above, and a harvest-now-decrypt-later surface.\nconst RE_JOSE_KEM = /['\"`](RSA-OAEP(?:-(?:256|384|512))?|RSA1_5)['\"`]/g;\n\nconst RULE_JWT_ALG: RuleMeta = {\n id: \"jwt-classical-alg\",\n title: \"Classical JWT/JOSE algorithm\",\n description: \"JWS alg tokens (RS/PS/ES/EdDSA)\",\n category: \"signature\",\n severity: \"high\",\n confidence: \"medium\",\n algorithm: \"unknown\",\n hndl: false,\n cwe: CWE_BROKEN_CRYPTO,\n message: \"A classical JWT/JOSE signature algorithm is used, forgeable by a quantum attacker.\",\n remediation: \"ML-DSA-65 (FIPS 204); track IETF PQC JOSE/COSE algorithms\",\n};\nconst RULE_JOSE_ECDH: RuleMeta = {\n id: \"jose-ecdh-es\",\n title: \"JOSE ECDH-ES key agreement\",\n description: \"JOSE ECDH-ES / ECDH-ES+A*KW key agreement\",\n category: \"key-exchange\",\n severity: \"high\",\n confidence: \"medium\",\n algorithm: \"ECDH\",\n hndl: true,\n cwe: CWE_BROKEN_CRYPTO,\n message:\n \"JOSE ECDH-ES performs classical ECDH key agreement — harvest-now-decrypt-later exposed.\",\n remediation: \"Track IETF PQC JOSE/COSE; adopt hybrid X25519MLKEM768 KEM-based encryption.\",\n};\nconst RULE_JOSE_RSA_OAEP: RuleMeta = {\n id: \"jose-rsa-oaep\",\n title: \"JOSE RSA key-transport algorithm\",\n description: \"JWE RSA-OAEP / RSA-OAEP-256/384/512 / RSA1_5 key encryption\",\n category: \"key-exchange\",\n severity: \"high\",\n confidence: \"medium\",\n algorithm: \"RSA\",\n hndl: true,\n cwe: CWE_BROKEN_CRYPTO,\n message:\n \"JOSE RSA key transport (RSA-OAEP / RSA1_5) is classical RSA encryption — harvest-now-decrypt-later exposed.\",\n remediation: \"Track IETF PQC JOSE/COSE; adopt hybrid X25519MLKEM768 KEM-based encryption.\",\n};\n\n/**\n * Detects classical signature algorithm identifiers used by JWT/JOSE, plus\n * ECDH-ES key-agreement identifiers (HNDL-exposed). These appear as string\n * literals: `alg: \"RS256\"`, `algorithms: [\"ES256\"]`, `enc: \"ECDH-ES+A256KW\"`.\n */\nconst jwtDetector: Detector = {\n id: \"jwt-jose\",\n description: \"Classical JWT/JOSE algorithms (RS/PS/ES/EdDSA) and ECDH-ES key agreement\",\n scope: \"source\",\n // Language-agnostic evidence: a quoted \"RS256\"/\"ES256\" alg token is the same\n // signal in JS/TS or Python (e.g. PyJWT `algorithm=\"RS256\"`), so this detector\n // is un-gated from JS-only to the JWT host surfaces.\n language: \"any\",\n rules: [RULE_JWT_ALG, RULE_JOSE_ECDH, RULE_JOSE_RSA_OAEP],\n appliesTo: (f) => hasExtension(f, JWT_HOST_EXTENSIONS),\n detect({ file, content }): Finding[] {\n const findings: Finding[] = [];\n\n // Classical JWS signature alg tokens. Anchored to quotes to avoid words.\n eachMatch(RE_JWT_ALG, content, (m) => {\n const alg = m[1];\n let algorithm: Finding[\"algorithm\"];\n if (alg.startsWith(\"RS\") || alg.startsWith(\"PS\")) algorithm = \"RSA\";\n else if (alg === \"EdDSA\") algorithm = \"EdDSA\";\n else algorithm = \"ECDSA\"; // ES*\n findings.push(\n findingFromRule(\n RULE_JWT_ALG,\n { file, content, index: m.index, matchLength: m[0].length },\n {\n title: `JWT/JOSE algorithm ${alg}`,\n algorithm,\n message: `JWT/JOSE algorithm \"${alg}\" is a classical signature, forgeable by a quantum attacker.`,\n },\n ),\n );\n });\n\n // JOSE ECDH-ES key agreement (and ECDH-ES+A*KW) — confidentiality, HNDL.\n eachMatch(RE_JOSE_ECDH, content, (m) => {\n findings.push(\n findingFromRule(\n RULE_JOSE_ECDH,\n { file, content, index: m.index, matchLength: m[0].length },\n {\n title: `JOSE key agreement ${m[1]}`,\n message: `JOSE \"${m[1]}\" performs classical ECDH key agreement — harvest-now-decrypt-later exposed.`,\n },\n ),\n );\n });\n\n // JOSE RSA key transport (RSA-OAEP / RSA1_5) — classical RSA encryption, HNDL.\n eachMatch(RE_JOSE_KEM, content, (m) => {\n findings.push(\n findingFromRule(\n RULE_JOSE_RSA_OAEP,\n { file, content, index: m.index, matchLength: m[0].length },\n {\n title: `JOSE RSA key transport ${m[1]}`,\n message: `JOSE \"${m[1]}\" is classical RSA key transport — harvest-now-decrypt-later exposed.`,\n },\n ),\n );\n });\n\n return findings;\n },\n};\n\n/* -------------------------------------------------------------------------- */\n/* TLS legacy configuration */\n/* -------------------------------------------------------------------------- */\n\nconst RULE_TLS_LEGACY: RuleMeta = {\n id: \"tls-legacy-version\",\n title: \"Legacy TLS version pinned\",\n description: \"minVersion/maxVersion/secureProtocol pinned to TLS 1.0/1.1\",\n category: \"tls\",\n severity: \"medium\",\n confidence: \"high\",\n hndl: false,\n cwe: CWE_WEAK_STRENGTH,\n message: \"TLS 1.0/1.1 are deprecated and insecure; require TLS 1.3.\",\n remediation: \"Set minVersion: 'TLSv1.3' and prefer PQC-hybrid key exchange.\",\n};\nconst RULE_TLS_REJECT: RuleMeta = {\n id: \"tls-reject-unauthorized\",\n title: \"TLS certificate verification disabled\",\n description: \"rejectUnauthorized: false\",\n category: \"tls\",\n severity: \"high\",\n confidence: \"high\",\n hndl: false,\n cwe: CWE_CERT_VALIDATION,\n message: \"rejectUnauthorized:false disables TLS certificate verification (MITM risk).\",\n remediation: \"Remove rejectUnauthorized:false; verify certificates properly.\",\n};\nconst RULE_TLS_WEAK_CIPHER: RuleMeta = {\n id: \"tls-weak-cipher\",\n title: \"Weak TLS cipher configured\",\n description: \"weak/export cipher in a `ciphers` string\",\n category: \"tls\",\n severity: \"medium\",\n confidence: \"medium\",\n hndl: false,\n cwe: CWE_WEAK_STRENGTH,\n message: \"A weak cipher is configured in the TLS ciphers list.\",\n remediation: \"Use a modern AEAD cipher suite (TLS 1.3 defaults).\",\n};\n\n/**\n * Detects legacy / insecure TLS configuration expressed as JS object literals:\n * forced TLS 1.0/1.1, disabled certificate verification, and weak ciphers.\n * These aren't quantum-specific but materially weaken transport security and\n * are squarely in qScan's \"config\" scope.\n */\nconst tlsDetector: Detector = {\n id: \"tls-config\",\n description: \"Legacy / insecure TLS configuration in JS objects\",\n scope: \"config\",\n language: \"js\",\n rules: [RULE_TLS_LEGACY, RULE_TLS_REJECT, RULE_TLS_WEAK_CIPHER],\n appliesTo: (f) => hasExtension(f, JS_TS_EXTENSIONS),\n detect({ file, content }): Finding[] {\n const findings: Finding[] = [];\n\n // minVersion / maxVersion / secureProtocol pinned to TLS 1.0 or 1.1.\n eachMatch(RE_TLS_LEGACY_VERSION, content, (m) => {\n findings.push(\n findingFromRule(RULE_TLS_LEGACY, {\n file,\n content,\n index: m.index,\n matchLength: m[0].length,\n }),\n );\n });\n\n // rejectUnauthorized: false — disables certificate verification.\n eachMatch(RE_TLS_REJECT, content, (m) => {\n findings.push(\n findingFromRule(RULE_TLS_REJECT, {\n file,\n content,\n index: m.index,\n matchLength: m[0].length,\n }),\n );\n });\n\n // Weak / export ciphers referenced in a ciphers string (bounded regex).\n eachMatch(RE_TLS_WEAK_CIPHER, content, (m) => {\n findings.push(\n findingFromRule(\n RULE_TLS_WEAK_CIPHER,\n { file, content, index: m.index, matchLength: m[0].length },\n { message: `Weak cipher (${m[1]}) configured in the TLS ciphers list.` },\n ),\n );\n });\n\n return findings;\n },\n};\n\n/* -------------------------------------------------------------------------- */\n/* SSH public keys + TLS certificate signature algorithms (config scope) */\n/* -------------------------------------------------------------------------- */\n\nconst RE_SSH_PUBKEY = /\\b(ssh-rsa|ssh-ed25519|ssh-dss|ecdsa-sha2-nistp(?:256|384|521))\\b/g;\nconst RE_CERT_SIG_ALG =\n /\\b(sha(?:1|256|384|512)WithRSAEncryption|ecdsa-with-SHA(?:1|256|384|512)|rsassaPss|dsaWithSHA(?:1|256))\\b/g;\n// Classical SSH key-exchange algorithm identifiers: finite-field DH groups\n// (diffie-hellman-group{1,14,15,16,17,18} + group-exchange), ECDH over NIST\n// curves (ecdh-sha2-nistp*), and Curve25519 (curve25519-sha256). All are\n// Shor-broken key agreement — the harvest-now-decrypt-later surface a lexical\n// scan misses when only the `crypto/*` API is matched, not the negotiated kex.\nconst RE_SSH_KEX =\n /\\b(diffie-hellman-group(?:1|14|15|16|17|18)(?:-sha1|-sha256|-sha512)?|diffie-hellman-group-exchange-sha(?:1|256)|ecdh-sha2-nistp(?:256|384|521)|curve25519-sha256)\\b/g;\n\nconst RULE_SSH_PUBKEY: RuleMeta = {\n id: \"ssh-public-key\",\n title: \"Classical SSH public key\",\n description: \"ssh-rsa / ssh-ed25519 / ssh-dss / ecdsa-sha2-* public keys\",\n category: \"certificate\",\n severity: \"low\",\n confidence: \"medium\",\n algorithm: \"unknown\",\n hndl: false,\n cwe: CWE_BROKEN_CRYPTO,\n sensitive: true,\n message: \"A classical SSH public key is forgeable by a quantum attacker.\",\n remediation:\n \"Plan migration to PQC-capable SSH: prefer the mlkem768x25519-sha256 KEX (ML-KEM-768 hybrid, OpenSSH 10's default since Apr 2025); sntrup761x25519 is an acceptable interim. Rotate to PQC host keys as they land.\",\n};\nconst RULE_CERT_SIG_ALG: RuleMeta = {\n id: \"cert-signature-algorithm\",\n title: \"Classical certificate signature algorithm\",\n description: \"X.509/TLS certificate signature-algorithm identifiers\",\n category: \"certificate\",\n severity: \"low\",\n confidence: \"medium\",\n algorithm: \"unknown\",\n hndl: false,\n cwe: CWE_BROKEN_CRYPTO,\n message:\n \"A classical certificate signature algorithm (RSA/ECDSA/DSA) is a quantum forgery surface.\",\n remediation: \"Plan re-issuance with PQC-capable CAs as ML-DSA certificate profiles mature.\",\n};\nconst RULE_SSH_KEX: RuleMeta = {\n id: \"ssh-kex-classical\",\n title: \"Classical SSH key exchange\",\n description: \"diffie-hellman-group* / group-exchange / ecdh-sha2-* / curve25519-sha256 kex\",\n category: \"key-exchange\",\n severity: \"medium\",\n confidence: \"medium\",\n algorithm: \"unknown\",\n hndl: true,\n cwe: CWE_BROKEN_CRYPTO,\n message:\n \"A classical SSH key-exchange algorithm (finite-field DH / ECDH / X25519) is harvest-now-decrypt-later exposed.\",\n remediation:\n \"Prefer the mlkem768x25519-sha256 KEX (ML-KEM-768 hybrid, OpenSSH 10 default); sntrup761x25519 is an acceptable interim.\",\n};\n\n/**\n * Detects classical SSH public keys (`authorized_keys` / `known_hosts` lines)\n * and X.509 certificate signature-algorithm identifiers in any text file. These\n * are language-agnostic config surfaces — the SSH-key forgery surface and the\n * PKI signature surface that lexical PEM detection misses.\n */\nconst sshCertDetector: Detector = {\n id: \"ssh-cert\",\n description: \"SSH public keys and TLS/X.509 certificate signature algorithms in config\",\n scope: \"config\",\n language: \"any\",\n rules: [RULE_SSH_PUBKEY, RULE_CERT_SIG_ALG, RULE_SSH_KEX],\n // Skip prose/docs: a changelog or README that merely mentions `ssh-rsa` in a\n // sentence is not crypto config. PEM material is caught by its own detector.\n appliesTo: (f) => !hasExtension(f, DOC_EXTENSIONS),\n detect({ file, content }): Finding[] {\n const findings: Finding[] = [];\n\n // SSH public keys: ssh-rsa AAAA…, ecdsa-sha2-nistp256 …, ssh-ed25519 …\n eachMatch(RE_SSH_PUBKEY, content, (m) => {\n const tok = m[1];\n const algorithm: Finding[\"algorithm\"] = tok.startsWith(\"ssh-rsa\")\n ? \"RSA\"\n : tok === \"ssh-ed25519\"\n ? \"EdDSA\"\n : tok === \"ssh-dss\"\n ? \"DSA\"\n : \"ECDSA\";\n findings.push(\n findingFromRule(\n RULE_SSH_PUBKEY,\n { file, content, index: m.index, matchLength: m[0].length },\n {\n title: `Classical SSH public key (${tok})`,\n algorithm,\n message: `SSH public key type \"${tok}\" is a classical key forgeable by a quantum attacker.`,\n },\n ),\n );\n });\n\n // X.509 / TLS certificate signature algorithm identifiers (forgery surface).\n eachMatch(RE_CERT_SIG_ALG, content, (m) => {\n const tok = m[1];\n const algorithm: Finding[\"algorithm\"] = /RSA|rsassa/i.test(tok)\n ? \"RSA\"\n : tok.startsWith(\"ecdsa\")\n ? \"ECDSA\"\n : \"DSA\";\n findings.push(\n findingFromRule(\n RULE_CERT_SIG_ALG,\n { file, content, index: m.index, matchLength: m[0].length },\n {\n title: `Classical certificate signature algorithm (${tok})`,\n algorithm,\n message: `Certificate signature algorithm \"${tok}\" is classical (RSA/ECDSA/DSA) — a quantum forgery surface.`,\n },\n ),\n );\n });\n\n // SSH key-exchange algorithm identifiers (finite-field DH / ECDH / X25519).\n eachMatch(RE_SSH_KEX, content, (m) => {\n const tok = m[1];\n const algorithm: Finding[\"algorithm\"] = tok.startsWith(\"diffie-hellman\")\n ? \"DH\"\n : tok.startsWith(\"ecdh\")\n ? \"ECDH\"\n : \"X25519\";\n findings.push(\n findingFromRule(\n RULE_SSH_KEX,\n { file, content, index: m.index, matchLength: m[0].length },\n {\n title: `Classical SSH key exchange (${tok})`,\n algorithm,\n message: `SSH key-exchange \"${tok}\" is classical (${algorithm}) — harvest-now-decrypt-later exposed.`,\n },\n ),\n );\n });\n\n return findings;\n },\n};\n\n/* -------------------------------------------------------------------------- */\n/* Classical TLS key-exchange cipher suites (language-agnostic config) */\n/* -------------------------------------------------------------------------- */\n\n// Classical KEX cipher-suite identifiers, in both the OpenSSL (`ECDHE-RSA-…`) and\n// IANA (`TLS_ECDHE_RSA_WITH_…`) spellings, with `-` or `_` separators. These name\n// a Shor-broken key exchange (ECDHE/DHE), so they are the harvest-now surface a\n// PQC scanner should flag — distinct from the legacy-*version* / weak-cipher rules\n// above. Case-sensitive on purpose: cipher-suite tokens are upper-case constants,\n// so prose like \"ecdhe rsa\" does not misfire. No trailing \\b so the IANA\n// `TLS_ECDHE_RSA_WITH_…` form (a `_` follows `RSA`) still matches.\nconst RE_TLS_CLASSICAL_KEX = /\\b(?:TLS_)?(?:ECDHE|ECDH|DHE)[-_](?:RSA|ECDSA|DSS)/g;\n\nconst RULE_TLS_CLASSICAL_KEX: RuleMeta = {\n id: \"tls-classical-kex\",\n title: \"Classical TLS key-exchange cipher suite\",\n description: \"ECDHE / DHE cipher suites negotiate Shor-broken key exchange\",\n category: \"tls\",\n severity: \"medium\",\n confidence: \"medium\",\n algorithm: \"unknown\",\n hndl: true,\n cwe: CWE_BROKEN_CRYPTO,\n message:\n \"Classical TLS key exchange (ECDHE/DHE) is harvest-now-decrypt-later exposed — the session key can be recorded now and recovered by a quantum attacker.\",\n remediation:\n \"Adopt a PQC-hybrid TLS 1.3 key exchange (e.g. X25519MLKEM768) as your stack and peers support it; keep classical suites only as a transitional fallback.\",\n};\n\n/**\n * Detects classical TLS key-exchange cipher suites in any text/config file\n * (OpenSSL cipher lists, IANA suite constants in Go/Java/C#/Rust, `.properties`,\n * etc.). Language-agnostic because the suite identifiers are the same tokens\n * everywhere — this is the cross-language TLS gap the legacy-version rule misses.\n */\nconst tlsClassicalKexDetector: Detector = {\n id: \"tls-cipher-suite\",\n description: \"Classical TLS key-exchange cipher suites (ECDHE/DHE) in any config\",\n scope: \"config\",\n language: \"any\",\n rules: [RULE_TLS_CLASSICAL_KEX],\n appliesTo: (f) => !hasExtension(f, DOC_EXTENSIONS),\n detect({ file, content }): Finding[] {\n const findings: Finding[] = [];\n eachMatch(RE_TLS_CLASSICAL_KEX, content, (m) => {\n const tok = m[0];\n const algorithm: Finding[\"algorithm\"] = tok.includes(\"ECDH\") ? \"ECDH\" : \"DH\";\n findings.push(\n findingFromRule(\n RULE_TLS_CLASSICAL_KEX,\n { file, content, index: m.index, matchLength: m[0].length },\n {\n algorithm,\n message: `Classical TLS key-exchange suite \"${tok}…\" (${algorithm}) is harvest-now-decrypt-later exposed.`,\n },\n ),\n );\n });\n return findings;\n },\n};\n\n/** All built-in source/config detectors, in run order. */\nexport const sourceDetectors: Detector[] = [\n nodeCryptoDetector,\n webCryptoDetector,\n libraryDetector,\n jwtDetector,\n tlsDetector,\n sshCertDetector,\n tlsClassicalKexDetector,\n];\n"]}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Config / source-agnostic detector: stateful hash-based signatures
3
+ * (NIST SP 800-208) — LMS, HSS, XMSS and XMSSMT.
4
+ *
5
+ * These schemes ARE quantum-safe and NIST-approved (SP 800-208, for firmware /
6
+ * secure-boot signing), so this is NOT a "broken crypto" finding. The hazard it
7
+ * flags is STATE MANAGEMENT: each private key holds a bounded set of one-time
8
+ * key indices, and reusing an index is catastrophic (it enables signature
9
+ * forgery). The detector therefore surfaces the usage so a reviewer can confirm
10
+ * rigorous state handling exists — or migrate to a stateless scheme.
11
+ *
12
+ * Like {@link pemDetector}, this is a `scope: "config"`, `language: "any"`
13
+ * detector that runs on every text file, because the distinctive LMS/XMSS
14
+ * parameter strings and library tokens (`LMS_SHA256_M32_H10`, `pyhsslms`,
15
+ * `XMSS-SHA2_10_256`, …) appear identically across languages, config, and docs.
16
+ * Every rule's metadata lives in the {@link RuleMeta} declaration below; the
17
+ * regexes are tightly bounded and `\b`-anchored to stay high-signal.
18
+ */
19
+ import type { Detector } from "../types.js";
20
+ /** Detects stateful hash-based signature (SP 800-208) usage in arbitrary files. */
21
+ export declare const statefulHbsDetector: Detector;
22
+ //# sourceMappingURL=stateful-hbs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stateful-hbs.d.ts","sourceRoot":"","sources":["../../src/detectors/stateful-hbs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAqB,MAAM,aAAa,CAAC;AAoI/D,mFAAmF;AACnF,eAAO,MAAM,mBAAmB,EAAE,QAyBjC,CAAC"}
@@ -0,0 +1,139 @@
1
+ import { eachMatch, findingFromRule } from "../detect-utils.js";
2
+ import { CWE_RISKY_PRIMITIVE } from "../cwe.js";
3
+ /**
4
+ * Shared remediation for every stateful-HBS finding: these are approved but
5
+ * STATEFUL, so the reviewer must confirm state management before trusting them.
6
+ */
7
+ const STATEFUL_HBS_REMEDIATION = "LMS/HSS/XMSS/XMSSMT are NIST-approved (SP 800-208) but STATEFUL: the signer " +
8
+ "must NEVER reuse a one-time key index (reuse enables signature forgery). Use " +
9
+ "only with rigorous, crash-safe state management; otherwise prefer the " +
10
+ "stateless ML-DSA (FIPS 204) or SLH-DSA (FIPS 205).";
11
+ const HBS_RULES = [
12
+ {
13
+ // LMS parameter set, e.g. LMS_SHA256_M32_H10 (RFC 8554 / SP 800-208).
14
+ re: /\bLMS_SHA256_[MN]\d+_[HW]\d+\b/g,
15
+ meta: {
16
+ id: "stateful-hbs-lms-param",
17
+ title: "LMS parameter set (stateful hash-based signature)",
18
+ description: "LMS/HSS one-time-signature parameter string (SP 800-208)",
19
+ category: "signature",
20
+ severity: "medium",
21
+ confidence: "high",
22
+ algorithm: "unknown",
23
+ hndl: false,
24
+ cwe: CWE_RISKY_PRIMITIVE,
25
+ message: "LMS parameter set — NIST-approved (SP 800-208) but STATEFUL: reusing a one-time key index is catastrophic.",
26
+ remediation: STATEFUL_HBS_REMEDIATION,
27
+ },
28
+ },
29
+ {
30
+ // HSS keygen (hierarchical LMS), e.g. pyhsslms.hss_generate_private_key(...).
31
+ re: /\bhss_generate_private_key\b/g,
32
+ meta: {
33
+ id: "stateful-hbs-hss-keygen",
34
+ title: "HSS private-key generation (stateful hash-based signature)",
35
+ description: "HSS (hierarchical LMS) private-key generation call (SP 800-208)",
36
+ category: "signature",
37
+ severity: "medium",
38
+ confidence: "high",
39
+ algorithm: "unknown",
40
+ hndl: false,
41
+ cwe: CWE_RISKY_PRIMITIVE,
42
+ message: "HSS private-key generation — NIST-approved (SP 800-208) but STATEFUL: never reuse a one-time key index.",
43
+ remediation: STATEFUL_HBS_REMEDIATION,
44
+ },
45
+ },
46
+ {
47
+ // pyhsslms — the Python LMS/HSS library import token.
48
+ re: /\bpyhsslms\b/g,
49
+ meta: {
50
+ id: "stateful-hbs-pyhsslms",
51
+ title: "pyhsslms library (stateful LMS/HSS signatures)",
52
+ description: "Reference to the pyhsslms LMS/HSS library (SP 800-208)",
53
+ category: "signature",
54
+ severity: "medium",
55
+ confidence: "high",
56
+ algorithm: "unknown",
57
+ hndl: false,
58
+ cwe: CWE_RISKY_PRIMITIVE,
59
+ message: "pyhsslms (LMS/HSS) — NIST-approved (SP 800-208) but STATEFUL: the signer must never reuse a one-time key index.",
60
+ remediation: STATEFUL_HBS_REMEDIATION,
61
+ },
62
+ },
63
+ {
64
+ // XMSS parameter set, e.g. XMSS-SHA2_10_256 (RFC 8391 / SP 800-208).
65
+ re: /\bXMSS-SHA2_\d+_256\b/g,
66
+ meta: {
67
+ id: "stateful-hbs-xmss-param",
68
+ title: "XMSS parameter set (stateful hash-based signature)",
69
+ description: "XMSS one-time-signature parameter string (SP 800-208)",
70
+ category: "signature",
71
+ severity: "medium",
72
+ confidence: "high",
73
+ algorithm: "unknown",
74
+ hndl: false,
75
+ cwe: CWE_RISKY_PRIMITIVE,
76
+ message: "XMSS parameter set — NIST-approved (SP 800-208) but STATEFUL: reusing a one-time key index is catastrophic.",
77
+ remediation: STATEFUL_HBS_REMEDIATION,
78
+ },
79
+ },
80
+ {
81
+ // XMSSMT (multi-tree XMSS) parameter set, e.g. XMSSMT-SHA2_20/2_256.
82
+ re: /\bXMSSMT-SHA2_\d+\b/g,
83
+ meta: {
84
+ id: "stateful-hbs-xmssmt-param",
85
+ title: "XMSSMT parameter set (stateful hash-based signature)",
86
+ description: "XMSSMT (multi-tree XMSS) parameter string (SP 800-208)",
87
+ category: "signature",
88
+ severity: "medium",
89
+ confidence: "high",
90
+ algorithm: "unknown",
91
+ hndl: false,
92
+ cwe: CWE_RISKY_PRIMITIVE,
93
+ message: "XMSSMT parameter set — NIST-approved (SP 800-208) but STATEFUL: never reuse a one-time key index.",
94
+ remediation: STATEFUL_HBS_REMEDIATION,
95
+ },
96
+ },
97
+ {
98
+ // XMSS keypair generation, e.g. xmss_keypair(...) (liboqs / xmss reference).
99
+ re: /\bxmss_keypair\b/g,
100
+ meta: {
101
+ id: "stateful-hbs-xmss-keypair",
102
+ title: "XMSS keypair generation (stateful hash-based signature)",
103
+ description: "XMSS keypair-generation call (SP 800-208)",
104
+ category: "signature",
105
+ severity: "medium",
106
+ confidence: "high",
107
+ algorithm: "unknown",
108
+ hndl: false,
109
+ cwe: CWE_RISKY_PRIMITIVE,
110
+ message: "XMSS keypair generation — NIST-approved (SP 800-208) but STATEFUL: the signer must never reuse a one-time key index.",
111
+ remediation: STATEFUL_HBS_REMEDIATION,
112
+ },
113
+ },
114
+ ];
115
+ /** Detects stateful hash-based signature (SP 800-208) usage in arbitrary files. */
116
+ export const statefulHbsDetector = {
117
+ id: "stateful-hbs",
118
+ description: "Stateful hash-based signatures (NIST SP 800-208: LMS / HSS / XMSS / XMSSMT) in any file",
119
+ scope: "config",
120
+ language: "any",
121
+ rules: HBS_RULES.map((r) => r.meta),
122
+ // Applies to every text file; the walker already filters out binaries.
123
+ appliesTo: () => true,
124
+ detect({ file, content }) {
125
+ const findings = [];
126
+ for (const rule of HBS_RULES) {
127
+ eachMatch(rule.re, content, (m) => {
128
+ findings.push(findingFromRule(rule.meta, {
129
+ file,
130
+ content,
131
+ index: m.index,
132
+ matchLength: m[0].length,
133
+ }));
134
+ });
135
+ }
136
+ return findings;
137
+ },
138
+ };
139
+ //# sourceMappingURL=stateful-hbs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stateful-hbs.js","sourceRoot":"","sources":["../../src/detectors/stateful-hbs.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD;;;GAGG;AACH,MAAM,wBAAwB,GAC5B,8EAA8E;IAC9E,+EAA+E;IAC/E,wEAAwE;IACxE,oDAAoD,CAAC;AASvD,MAAM,SAAS,GAAc;IAC3B;QACE,sEAAsE;QACtE,EAAE,EAAE,iCAAiC;QACrC,IAAI,EAAE;YACJ,EAAE,EAAE,wBAAwB;YAC5B,KAAK,EAAE,mDAAmD;YAC1D,WAAW,EAAE,0DAA0D;YACvE,QAAQ,EAAE,WAAW;YACrB,QAAQ,EAAE,QAAQ;YAClB,UAAU,EAAE,MAAM;YAClB,SAAS,EAAE,SAAS;YACpB,IAAI,EAAE,KAAK;YACX,GAAG,EAAE,mBAAmB;YACxB,OAAO,EACL,4GAA4G;YAC9G,WAAW,EAAE,wBAAwB;SACtC;KACF;IACD;QACE,8EAA8E;QAC9E,EAAE,EAAE,+BAA+B;QACnC,IAAI,EAAE;YACJ,EAAE,EAAE,yBAAyB;YAC7B,KAAK,EAAE,4DAA4D;YACnE,WAAW,EAAE,iEAAiE;YAC9E,QAAQ,EAAE,WAAW;YACrB,QAAQ,EAAE,QAAQ;YAClB,UAAU,EAAE,MAAM;YAClB,SAAS,EAAE,SAAS;YACpB,IA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AAE;YACJ,EAAE,EAAE,2BAA2B;YAC/B,KAAK,EAAE,yDAAyD;YAChE,WAAW,EAAE,2CAA2C;YACxD,QAAQ,EAAE,WAAW;YACrB,QAAQ,EAAE,QAAQ;YAClB,UAAU,EAAE,MAAM;YAClB,SAAS,EAAE,SAAS;YACpB,IAAI,EAAE,KAAK;YACX,GAAG,EAAE,mBAAmB;YACxB,OAAO,EACL,sHAAsH;YACxH,WAAW,EAAE,wBAAwB;SACtC;KACF;CACF,CAAC;AAEF,mFAAmF;AACnF,MAAM,CAAC,MAAM,mBAAmB,GAAa;IAC3C,EAAE,EAAE,cAAc;IAClB,WAAW,EACT,yFAAyF;IAC3F,KAAK,EAAE,QAAQ;IACf,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACnC,uEAAuE;IACvE,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI;IACrB,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE;QACtB,MAAM,QAAQ,GAAc,EAAE,CAAC;QAC/B,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;YAC7B,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;gBAChC,QAAQ,CAAC,IAAI,CACX,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE;oBACzB,IAAI;oBACJ,OAAO;oBACP,KAAK,EAAE,CAAC,CAAC,KAAK;oBACd,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM;iBACzB,CAAC,CACH,CAAC;YACJ,CAAC,CAAC,CAAC;QACL,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF,CAAC","sourcesContent":["/**\n * Config / source-agnostic detector: stateful hash-based signatures\n * (NIST SP 800-208) — LMS, HSS, XMSS and XMSSMT.\n *\n * These schemes ARE quantum-safe and NIST-approved (SP 800-208, for firmware /\n * secure-boot signing), so this is NOT a \"broken crypto\" finding. The hazard it\n * flags is STATE MANAGEMENT: each private key holds a bounded set of one-time\n * key indices, and reusing an index is catastrophic (it enables signature\n * forgery). The detector therefore surfaces the usage so a reviewer can confirm\n * rigorous state handling exists — or migrate to a stateless scheme.\n *\n * Like {@link pemDetector}, this is a `scope: \"config\"`, `language: \"any\"`\n * detector that runs on every text file, because the distinctive LMS/XMSS\n * parameter strings and library tokens (`LMS_SHA256_M32_H10`, `pyhsslms`,\n * `XMSS-SHA2_10_256`, …) appear identically across languages, config, and docs.\n * Every rule's metadata lives in the {@link RuleMeta} declaration below; the\n * regexes are tightly bounded and `\\b`-anchored to stay high-signal.\n */\nimport type { Detector, Finding, RuleMeta } from \"../types.js\";\nimport { eachMatch, findingFromRule } from \"../detect-utils.js\";\nimport { CWE_RISKY_PRIMITIVE } from \"../cwe.js\";\n\n/**\n * Shared remediation for every stateful-HBS finding: these are approved but\n * STATEFUL, so the reviewer must confirm state management before trusting them.\n */\nconst STATEFUL_HBS_REMEDIATION =\n \"LMS/HSS/XMSS/XMSSMT are NIST-approved (SP 800-208) but STATEFUL: the signer \" +\n \"must NEVER reuse a one-time key index (reuse enables signature forgery). Use \" +\n \"only with rigorous, crash-safe state management; otherwise prefer the \" +\n \"stateless ML-DSA (FIPS 204) or SLH-DSA (FIPS 205).\";\n\n/** A stateful-HBS rule: its catalog metadata plus the token regex that triggers it. */\ninterface HbsRule {\n /** Global regex matching the distinctive token. */\n re: RegExp;\n meta: RuleMeta;\n}\n\nconst HBS_RULES: HbsRule[] = [\n {\n // LMS parameter set, e.g. LMS_SHA256_M32_H10 (RFC 8554 / SP 800-208).\n re: /\\bLMS_SHA256_[MN]\\d+_[HW]\\d+\\b/g,\n meta: {\n id: \"stateful-hbs-lms-param\",\n title: \"LMS parameter set (stateful hash-based signature)\",\n description: \"LMS/HSS one-time-signature parameter string (SP 800-208)\",\n category: \"signature\",\n severity: \"medium\",\n confidence: \"high\",\n algorithm: \"unknown\",\n hndl: false,\n cwe: CWE_RISKY_PRIMITIVE,\n message:\n \"LMS parameter set — NIST-approved (SP 800-208) but STATEFUL: reusing a one-time key index is catastrophic.\",\n remediation: STATEFUL_HBS_REMEDIATION,\n },\n },\n {\n // HSS keygen (hierarchical LMS), e.g. pyhsslms.hss_generate_private_key(...).\n re: /\\bhss_generate_private_key\\b/g,\n meta: {\n id: \"stateful-hbs-hss-keygen\",\n title: \"HSS private-key generation (stateful hash-based signature)\",\n description: \"HSS (hierarchical LMS) private-key generation call (SP 800-208)\",\n category: \"signature\",\n severity: \"medium\",\n confidence: \"high\",\n algorithm: \"unknown\",\n hndl: false,\n cwe: CWE_RISKY_PRIMITIVE,\n message:\n \"HSS private-key generation — NIST-approved (SP 800-208) but STATEFUL: never reuse a one-time key index.\",\n remediation: STATEFUL_HBS_REMEDIATION,\n },\n },\n {\n // pyhsslms — the Python LMS/HSS library import token.\n re: /\\bpyhsslms\\b/g,\n meta: {\n id: \"stateful-hbs-pyhsslms\",\n title: \"pyhsslms library (stateful LMS/HSS signatures)\",\n description: \"Reference to the pyhsslms LMS/HSS library (SP 800-208)\",\n category: \"signature\",\n severity: \"medium\",\n confidence: \"high\",\n algorithm: \"unknown\",\n hndl: false,\n cwe: CWE_RISKY_PRIMITIVE,\n message:\n \"pyhsslms (LMS/HSS) — NIST-approved (SP 800-208) but STATEFUL: the signer must never reuse a one-time key index.\",\n remediation: STATEFUL_HBS_REMEDIATION,\n },\n },\n {\n // XMSS parameter set, e.g. XMSS-SHA2_10_256 (RFC 8391 / SP 800-208).\n re: /\\bXMSS-SHA2_\\d+_256\\b/g,\n meta: {\n id: \"stateful-hbs-xmss-param\",\n title: \"XMSS parameter set (stateful hash-based signature)\",\n description: \"XMSS one-time-signature parameter string (SP 800-208)\",\n category: \"signature\",\n severity: \"medium\",\n confidence: \"high\",\n algorithm: \"unknown\",\n hndl: false,\n cwe: CWE_RISKY_PRIMITIVE,\n message:\n \"XMSS parameter set — NIST-approved (SP 800-208) but STATEFUL: reusing a one-time key index is catastrophic.\",\n remediation: STATEFUL_HBS_REMEDIATION,\n },\n },\n {\n // XMSSMT (multi-tree XMSS) parameter set, e.g. XMSSMT-SHA2_20/2_256.\n re: /\\bXMSSMT-SHA2_\\d+\\b/g,\n meta: {\n id: \"stateful-hbs-xmssmt-param\",\n title: \"XMSSMT parameter set (stateful hash-based signature)\",\n description: \"XMSSMT (multi-tree XMSS) parameter string (SP 800-208)\",\n category: \"signature\",\n severity: \"medium\",\n confidence: \"high\",\n algorithm: \"unknown\",\n hndl: false,\n cwe: CWE_RISKY_PRIMITIVE,\n message:\n \"XMSSMT parameter set — NIST-approved (SP 800-208) but STATEFUL: never reuse a one-time key index.\",\n remediation: STATEFUL_HBS_REMEDIATION,\n },\n },\n {\n // XMSS keypair generation, e.g. xmss_keypair(...) (liboqs / xmss reference).\n re: /\\bxmss_keypair\\b/g,\n meta: {\n id: \"stateful-hbs-xmss-keypair\",\n title: \"XMSS keypair generation (stateful hash-based signature)\",\n description: \"XMSS keypair-generation call (SP 800-208)\",\n category: \"signature\",\n severity: \"medium\",\n confidence: \"high\",\n algorithm: \"unknown\",\n hndl: false,\n cwe: CWE_RISKY_PRIMITIVE,\n message:\n \"XMSS keypair generation — NIST-approved (SP 800-208) but STATEFUL: the signer must never reuse a one-time key index.\",\n remediation: STATEFUL_HBS_REMEDIATION,\n },\n },\n];\n\n/** Detects stateful hash-based signature (SP 800-208) usage in arbitrary files. */\nexport const statefulHbsDetector: Detector = {\n id: \"stateful-hbs\",\n description:\n \"Stateful hash-based signatures (NIST SP 800-208: LMS / HSS / XMSS / XMSSMT) in any file\",\n scope: \"config\",\n language: \"any\",\n rules: HBS_RULES.map((r) => r.meta),\n // Applies to every text file; the walker already filters out binaries.\n appliesTo: () => true,\n detect({ file, content }): Finding[] {\n const findings: Finding[] = [];\n for (const rule of HBS_RULES) {\n eachMatch(rule.re, content, (m) => {\n findings.push(\n findingFromRule(rule.meta, {\n file,\n content,\n index: m.index,\n matchLength: m[0].length,\n }),\n );\n });\n }\n return findings;\n },\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,MAAM,OAAO,UAAW,SAAQ,KAAK;IACjB,IAAI,GAAG,YAAY,CAAC;IACtC,YAAY,OAAO,GAAG,uBAAuB;QAC3C,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF;AAED,mFAAmF;AACnF,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAC1B,IAAI,GAAG,qBAAqB,CAAC;IAC/C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF"}
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,MAAM,OAAO,UAAW,SAAQ,KAAK;IACjB,IAAI,GAAG,YAAY,CAAC;IACtC,YAAY,OAAO,GAAG,uBAAuB;QAC3C,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF;AAED,mFAAmF;AACnF,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAC1B,IAAI,GAAG,qBAAqB,CAAC;IAC/C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF","sourcesContent":["/**\n * Error types thrown by {@link scan} when cooperative cancellation or a work\n * budget kicks in. Kept in their own module so every consumer (qScan, the MCP\n * server, the Action) can `instanceof`-check them without importing the scanner.\n */\n\n/**\n * Thrown when a scan is aborted via `ScanOptions.signal`. `name` is `\"AbortError\"`\n * to match the Web platform convention (`AbortController` / `DOMException`), so\n * callers that already special-case `err.name === \"AbortError\"` keep working.\n */\nexport class AbortError extends Error {\n override readonly name = \"AbortError\";\n constructor(message = \"The scan was aborted.\") {\n super(message);\n }\n}\n\n/** Thrown when a scan exceeds its `maxFiles` / `maxBytes` work budget mid-walk. */\nexport class BudgetExceededError extends Error {\n override readonly name = \"BudgetExceededError\";\n constructor(message: string) {\n super(message);\n }\n}\n"]}
@@ -0,0 +1,48 @@
1
+ import type { ScanResult } from "./types.js";
2
+ /** Stable per-finding record for the evidence body (deterministic per commit). */
3
+ export interface EvidenceFinding {
4
+ ruleId: string;
5
+ algorithm?: string;
6
+ severity: string;
7
+ hndl: boolean;
8
+ file: string;
9
+ line: number;
10
+ }
11
+ export interface ReadinessReport {
12
+ reportType: "quantakrypto-readiness";
13
+ specVersion: 1;
14
+ subject: {
15
+ repository: string | null;
16
+ commit: string | null;
17
+ scannedRoot: string;
18
+ scanTimeUtc: string;
19
+ };
20
+ tool: {
21
+ name: "qScan";
22
+ version: string;
23
+ };
24
+ inventory: ScanResult["inventory"];
25
+ findings: EvidenceFinding[];
26
+ cbom: unknown;
27
+ attestation: {
28
+ /** sha256 over the canonicalized deterministic body (excludes scanTimeUtc). */
29
+ contentHash: string;
30
+ /** RFC-3161 / transparency-log token — filled by an external signer. */
31
+ timestamp: null;
32
+ /** Detached signature over `contentHash` — filled by an external signer. */
33
+ signature: null;
34
+ };
35
+ }
36
+ export interface ReadinessReportOptions {
37
+ /** Repository URL (e.g. from `GITHUB_REPOSITORY`); omitted → null. */
38
+ repository?: string;
39
+ /** Full commit SHA (e.g. from `GITHUB_SHA`); omitted → null. */
40
+ commit?: string;
41
+ }
42
+ /**
43
+ * Build the A.8.24 readiness report for a scan result. The attestation's
44
+ * `contentHash` covers everything EXCEPT the scan timestamp and the attestation
45
+ * block itself, so re-running the same scan on the same commit is verifiable.
46
+ */
47
+ export declare function buildReadinessReport(result: ScanResult, opts?: ReadinessReportOptions): ReadinessReport;
48
+ //# sourceMappingURL=evidence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evidence.d.ts","sourceRoot":"","sources":["../src/evidence.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,UAAU,EA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md).
4
+ *
5
+ * Emits a self-describing readiness report bundling the scan result, crypto
6
+ * inventory, and CycloneDX CBOM, plus an attestation carrying a DETERMINISTIC
7
+ * content hash — the same scan over the same commit + config yields the same
8
+ * hash (the volatile scan timestamp is deliberately excluded from the hashed
9
+ * body). Signing + RFC-3161 timestamping are left to an EXTERNAL, vetted signer
10
+ * (ADR-0004: this project performs no cryptography itself — it orchestrates a
11
+ * signer, it does not implement one). SHA-256 here is an integrity hash (a Node
12
+ * built-in), not an asymmetric primitive.
13
+ *
14
+ * Honesty boundary: this artifact is EVIDENCE for A.8.24, not the control. The
15
+ * organization still owns the cryptography policy, key management, and the
16
+ * conformance judgment. A clean scan is the absence of detected candidates, not
17
+ * proof of quantum-safety (qScan is lexical). See docs/COMPLIANCE.md §3.
18
+ */
19
+ import { createHash } from "node:crypto";
20
+ import { toCbom } from "./cbom.js";
21
+ import { VERSION } from "./version.js";
22
+ /** Canonical JSON: object keys sorted recursively, so the hash is reproducible. */
23
+ function canonicalize(value) {
24
+ if (Array.isArray(value))
25
+ return value.map(canonicalize);
26
+ if (value && typeof value === "object") {
27
+ const out = {};
28
+ for (const k of Object.keys(value).sort()) {
29
+ out[k] = canonicalize(value[k]);
30
+ }
31
+ return out;
32
+ }
33
+ return value;
34
+ }
35
+ /**
36
+ * Build the A.8.24 readiness report for a scan result. The attestation's
37
+ * `contentHash` covers everything EXCEPT the scan timestamp and the attestation
38
+ * block itself, so re-running the same scan on the same commit is verifiable.
39
+ */
40
+ export function buildReadinessReport(result, opts = {}) {
41
+ const findings = result.findings.map((f) => ({
42
+ ruleId: f.ruleId,
43
+ ...(f.algorithm ? { algorithm: f.algorithm } : {}),
44
+ severity: f.severity,
45
+ hndl: f.hndl,
46
+ file: f.location.file,
47
+ line: f.location.line,
48
+ }));
49
+ // The CBOM is a deterministic *view* of the (hashed) findings + inventory, but
50
+ // its CycloneDX envelope carries a volatile timestamp/serial — so it is
51
+ // EXCLUDED from the hashed body (its integrity follows from its hashed inputs)
52
+ // to keep the content hash reproducible across scan runs on the same commit.
53
+ const hashableBody = {
54
+ reportType: "quantakrypto-readiness",
55
+ specVersion: 1,
56
+ subject: {
57
+ repository: opts.repository ?? null,
58
+ commit: opts.commit ?? null,
59
+ scannedRoot: result.root,
60
+ },
61
+ tool: { name: "qScan", version: VERSION },
62
+ inventory: result.inventory,
63
+ findings,
64
+ };
65
+ const contentHash = "sha256:" +
66
+ createHash("sha256")
67
+ .update(JSON.stringify(canonicalize(hashableBody)))
68
+ .digest("hex");
69
+ return {
70
+ ...hashableBody,
71
+ subject: { ...hashableBody.subject, scanTimeUtc: result.finishedAt },
72
+ cbom: toCbom(result),
73
+ attestation: { contentHash, timestamp: null, signature: null },
74
+ };
75
+ }
76
+ //# sourceMappingURL=evidence.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evidence.js","sourceRoot":"","sources":["../src/evidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAmCvC,mFAAmF;AACnF,SAAS,YAAY,CAAC,KAAc;IAClC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACzD,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACvC,MAAM,GAAG,GAA4B,EAAE,CAAC;QACxC,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,KAAgC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;YACrE,GAAG,CAAC,CAAC,CAAC,GAAG,YAAY,CAAE,KAAiC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/D,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IACD,OAAO,KA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E,WAAW,EAAE,MAAM,CAAC,UAAU,EAAE;QACpE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC;QACpB,WAAW,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE;KAC5C,CAAC;AACvB,CAAC","sourcesContent":["/**\n * ISO/IEC 27001:2022 Annex A 8.24 evidence-chain export\n * (docs/compliance/iso27001-a8.24-evidence.md).\n *\n * Emits a self-describing readiness report bundling the scan result, crypto\n * inventory, and CycloneDX CBOM, plus an attestation carrying a DETERMINISTIC\n * content hash — the same scan over the same commit + config yields the same\n * hash (the volatile scan timestamp is deliberately excluded from the hashed\n * body). Signing + RFC-3161 timestamping are left to an EXTERNAL, vetted signer\n * (ADR-0004: this project performs no cryptography itself — it orchestrates a\n * signer, it does not implement one). SHA-256 here is an integrity hash (a Node\n * built-in), not an asymmetric primitive.\n *\n * Honesty boundary: this artifact is EVIDENCE for A.8.24, not the control. The\n * organization still owns the cryptography policy, key management, and the\n * conformance judgment. A clean scan is the absence of detected candidates, not\n * proof of quantum-safety (qScan is lexical). See docs/COMPLIANCE.md §3.\n */\nimport { createHash } from \"node:crypto\";\n\nimport type { ScanResult } from \"./types.js\";\nimport { toCbom } from \"./cbom.js\";\nimport { VERSION } from \"./version.js\";\n\n/** Stable per-finding record for the evidence body (deterministic per commit). */\nexport interface EvidenceFinding {\n ruleId: string;\n algorithm?: string;\n severity: string;\n hndl: boolean;\n file: string;\n line: number;\n}\n\nexport interface ReadinessReport {\n reportType: \"quantakrypto-readiness\";\n specVersion: 1;\n subject: {\n repository: string | null;\n commit: string | null;\n scannedRoot: string;\n scanTimeUtc: string;\n };\n tool: { name: \"qScan\"; version: string };\n inventory: ScanResult[\"inventory\"];\n findings: EvidenceFinding[];\n cbom: unknown;\n attestation: {\n /** sha256 over the canonicalized deterministic body (excludes scanTimeUtc). */\n contentHash: string;\n /** RFC-3161 / transparency-log token — filled by an external signer. */\n timestamp: null;\n /** Detached signature over `contentHash` — filled by an external signer. */\n signature: null;\n };\n}\n\n/** Canonical JSON: object keys sorted recursively, so the hash is reproducible. */\nfunction canonicalize(value: unknown): unknown {\n if (Array.isArray(value)) return value.map(canonicalize);\n if (value && typeof value === \"object\") {\n const out: Record<string, unknown> = {};\n for (const k of Object.keys(value as Record<string, unknown>).sort()) {\n out[k] = canonicalize((value as Record<string, unknown>)[k]);\n }\n return out;\n }\n return value;\n}\n\nexport interface ReadinessReportOptions {\n /** Repository URL (e.g. from `GITHUB_REPOSITORY`); omitted → null. */\n repository?: string;\n /** Full commit SHA (e.g. from `GITHUB_SHA`); omitted → null. */\n commit?: string;\n}\n\n/**\n * Build the A.8.24 readiness report for a scan result. The attestation's\n * `contentHash` covers everything EXCEPT the scan timestamp and the attestation\n * block itself, so re-running the same scan on the same commit is verifiable.\n */\nexport function buildReadinessReport(\n result: ScanResult,\n opts: ReadinessReportOptions = {},\n): ReadinessReport {\n const findings: EvidenceFinding[] = result.findings.map((f) => ({\n ruleId: f.ruleId,\n ...(f.algorithm ? { algorithm: f.algorithm } : {}),\n severity: f.severity,\n hndl: f.hndl,\n file: f.location.file,\n line: f.location.line,\n }));\n\n // The CBOM is a deterministic *view* of the (hashed) findings + inventory, but\n // its CycloneDX envelope carries a volatile timestamp/serial — so it is\n // EXCLUDED from the hashed body (its integrity follows from its hashed inputs)\n // to keep the content hash reproducible across scan runs on the same commit.\n const hashableBody = {\n reportType: \"quantakrypto-readiness\",\n specVersion: 1,\n subject: {\n repository: opts.repository ?? null,\n commit: opts.commit ?? null,\n scannedRoot: result.root,\n },\n tool: { name: \"qScan\", version: VERSION },\n inventory: result.inventory,\n findings,\n };\n const contentHash =\n \"sha256:\" +\n createHash(\"sha256\")\n .update(JSON.stringify(canonicalize(hashableBody)))\n .digest(\"hex\");\n\n return {\n ...hashableBody,\n subject: { ...hashableBody.subject, scanTimeUtc: result.finishedAt },\n cbom: toCbom(result),\n attestation: { contentHash, timestamp: null, signature: null },\n } as ReadinessReport;\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -42,11 +42,13 @@ export { isAnalyzableSource, ANALYZABLE_SOURCE_EXTENSIONS, ANALYZABLE_LANGUAGES_
42
42
  export { buildInventory } from "./inventory.js";
43
43
  export { vulnerableDependencies, DEP_VULNERABLE_RULE, isManifestFile } from "./dependencies.js";
44
44
  export { SEVERITY_ORDER, severityRank, meetsThreshold, sarifLevel } from "./severity.js";
45
- export { toSarif, toJson, formatSummary } from "./report.js";
45
+ export { toSarif, toJson, formatSummary, formatTierGuidance } from "./report.js";
46
46
  export type { ReportOptions } from "./report.js";
47
47
  export { toCbom } from "./cbom.js";
48
48
  export type { CycloneDxBom, CbomComponent } from "./cbom.js";
49
- export { remediationFor, remediationForTier, TIER_PARAMS, STATEFUL_HBS_NOTE, statefulHbsApplies, } from "./remediation.js";
49
+ export { buildReadinessReport } from "./evidence.js";
50
+ export type { ReadinessReport, EvidenceFinding, ReadinessReportOptions } from "./evidence.js";
51
+ export { remediationFor, remediationForTier, TIER_PARAMS, STATEFUL_HBS_NOTE, PQC_TRANSITION_NOTE, statefulHbsApplies, } from "./remediation.js";
50
52
  export type { SecurityTier } from "./remediation.js";
51
53
  export { CWE_BROKEN_CRYPTO, CWE_WEAK_STRENGTH, CWE_CERT_VALIDATION, CWE_HARDCODED_KEY, CWE_RISKY_PRIMITIVE, } from "./cwe.js";
52
54
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,cAAc,YAAY,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG5C,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAGzE,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,M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AAO,EAAE,MAAM,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjF,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAG9F,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGrD,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,UAAU,CAAC"}
package/dist/index.js CHANGED
@@ -47,11 +47,13 @@ export { vulnerableDependencies, DEP_VULNERABLE_RULE, isManifestFile } from "./d
47
47
  // Severity utilities (ordering, threshold, SARIF level) — shared across tools.
48
48
  export { SEVERITY_ORDER, severityRank, meetsThreshold, sarifLevel } from "./severity.js";
49
49
  // Reporters.
50
- export { toSarif, toJson, formatSummary } from "./report.js";
50
+ export { toSarif, toJson, formatSummary, formatTierGuidance } from "./report.js";
51
51
  // CycloneDX 1.6 cryptographic bill of materials (CBOM) export.
52
52
  export { toCbom } from "./cbom.js";
53
+ // ISO/IEC 27001 A.8.24 evidence-chain readiness report.
54
+ export { buildReadinessReport } from "./evidence.js";
53
55
  // Remediation lookup (family + tier-aware) and stateful-HBS guidance.
54
- export { remediationFor, remediationForTier, TIER_PARAMS, STATEFUL_HBS_NOTE, statefulHbsApplies, } from "./remediation.js";
56
+ export { remediationFor, remediationForTier, TIER_PARAMS, STATEFUL_HBS_NOTE, PQC_TRANSITION_NOTE, statefulHbsApplies, } from "./remediation.js";
55
57
  // CWE identifier constants.
56
58
  export { CWE_BROKEN_CRYPTO, CWE_WEAK_STRENGTH, CWE_CERT_VALIDATION, CWE_HARDCODED_KEY, CWE_RISKY_PRIMITIVE, } from "./cwe.js";
57
59
  //# sourceMappingURL=index.js.map