vigievuln 1.3.2 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/README.md +34 -19
  3. package/completions/vigievuln.bash +14 -3
  4. package/completions/vigievuln.zsh +11 -8
  5. package/data/fingerprints/index.js +80 -0
  6. package/data/fingerprints/interpreters/javascript/bun.json +23 -0
  7. package/data/fingerprints/interpreters/javascript/deno.json +10 -0
  8. package/data/fingerprints/interpreters/javascript/electron.json +20 -0
  9. package/data/fingerprints/interpreters/javascript/gjs.json +8 -0
  10. package/data/fingerprints/interpreters/javascript/javascriptcore.json +14 -0
  11. package/data/fingerprints/interpreters/javascript/jscgtk.json +10 -0
  12. package/data/fingerprints/interpreters/javascript/node.json +26 -0
  13. package/data/fingerprints/interpreters/javascript/nwjs.json +8 -0
  14. package/data/fingerprints/interpreters/javascript/webkitgtk.json +10 -0
  15. package/data/fingerprints/interpreters/javascript/wpewebkit.json +10 -0
  16. package/data/fingerprints/interpreters/languages/dotnet.json +8 -0
  17. package/data/fingerprints/interpreters/languages/erlang.json +9 -0
  18. package/data/fingerprints/interpreters/languages/gawk.json +10 -0
  19. package/data/fingerprints/interpreters/languages/guile.json +9 -0
  20. package/data/fingerprints/interpreters/languages/java.json +8 -0
  21. package/data/fingerprints/interpreters/languages/julia.json +9 -0
  22. package/data/fingerprints/interpreters/languages/lua.json +11 -0
  23. package/data/fingerprints/interpreters/languages/luajit.json +10 -0
  24. package/data/fingerprints/interpreters/languages/perl.json +11 -0
  25. package/data/fingerprints/interpreters/languages/php.json +22 -0
  26. package/data/fingerprints/interpreters/languages/powershell.json +17 -0
  27. package/data/fingerprints/interpreters/languages/pypy.json +8 -0
  28. package/data/fingerprints/interpreters/languages/python.json +24 -0
  29. package/data/fingerprints/interpreters/languages/r.json +9 -0
  30. package/data/fingerprints/interpreters/languages/racket.json +9 -0
  31. package/data/fingerprints/interpreters/languages/raku.json +8 -0
  32. package/data/fingerprints/interpreters/languages/ruby.json +21 -0
  33. package/data/fingerprints/interpreters/languages/tcl.json +9 -0
  34. package/data/fingerprints/interpreters/shells/bash.json +10 -0
  35. package/data/fingerprints/interpreters/shells/dash.json +8 -0
  36. package/data/fingerprints/interpreters/shells/fish.json +9 -0
  37. package/data/fingerprints/interpreters/shells/ksh.json +8 -0
  38. package/data/fingerprints/interpreters/shells/zsh.json +9 -0
  39. package/data/fingerprints/services/databases/clickhouse.json +8 -0
  40. package/data/fingerprints/services/databases/elasticsearch.json +8 -0
  41. package/data/fingerprints/services/databases/etcd.json +9 -0
  42. package/data/fingerprints/services/databases/mariadb.json +9 -0
  43. package/data/fingerprints/services/databases/memcached.json +9 -0
  44. package/data/fingerprints/services/databases/mongo.json +8 -0
  45. package/data/fingerprints/services/databases/mysql.json +9 -0
  46. package/data/fingerprints/services/databases/opensearch.json +8 -0
  47. package/data/fingerprints/services/databases/postgres.json +18 -0
  48. package/data/fingerprints/services/databases/redis.json +9 -0
  49. package/data/fingerprints/services/databases/valkey.json +8 -0
  50. package/data/fingerprints/services/dns-directory/bind.json +8 -0
  51. package/data/fingerprints/services/dns-directory/dnsmasq.json +8 -0
  52. package/data/fingerprints/services/dns-directory/slapd.json +8 -0
  53. package/data/fingerprints/services/dns-directory/unbound.json +8 -0
  54. package/data/fingerprints/services/mail/cyrus.json +8 -0
  55. package/data/fingerprints/services/mail/dovecot.json +8 -0
  56. package/data/fingerprints/services/mail/exim.json +9 -0
  57. package/data/fingerprints/services/mail/opendkim.json +8 -0
  58. package/data/fingerprints/services/mail/opensmtpd.json +8 -0
  59. package/data/fingerprints/services/mail/postfix.json +8 -0
  60. package/data/fingerprints/services/mail/rspamd.json +8 -0
  61. package/data/fingerprints/services/mail/sendmail.json +8 -0
  62. package/data/fingerprints/services/messaging/kafka.json +8 -0
  63. package/data/fingerprints/services/messaging/mosquitto.json +8 -0
  64. package/data/fingerprints/services/messaging/nats.json +9 -0
  65. package/data/fingerprints/services/messaging/rabbitmq.json +8 -0
  66. package/data/fingerprints/services/remote-access/dropbear.json +8 -0
  67. package/data/fingerprints/services/remote-access/openssh.json +10 -0
  68. package/data/fingerprints/services/remote-access/proftpd.json +8 -0
  69. package/data/fingerprints/services/remote-access/samba.json +8 -0
  70. package/data/fingerprints/services/remote-access/vsftpd.json +8 -0
  71. package/data/fingerprints/services/web-proxies/apache.json +18 -0
  72. package/data/fingerprints/services/web-proxies/caddy.json +9 -0
  73. package/data/fingerprints/services/web-proxies/envoy.json +8 -0
  74. package/data/fingerprints/services/web-proxies/haproxy.json +10 -0
  75. package/data/fingerprints/services/web-proxies/lighttpd.json +8 -0
  76. package/data/fingerprints/services/web-proxies/nginx.json +14 -0
  77. package/data/fingerprints/services/web-proxies/squid.json +8 -0
  78. package/data/fingerprints/services/web-proxies/tomcat.json +8 -0
  79. package/data/fingerprints/services/web-proxies/traefik.json +9 -0
  80. package/data/fingerprints/services/web-proxies/varnish.json +8 -0
  81. package/lib/README.md +51 -0
  82. package/lib/{coverage-diagnostics.js → advisories/coverage-diagnostics.js} +1 -1
  83. package/lib/{cve-match.js → advisories/cve-match.js} +17 -12
  84. package/lib/{advisory-fixes.js → advisories/fixes.js} +1 -1
  85. package/lib/{advisory-freshness.js → advisories/freshness.js} +5 -1
  86. package/lib/{gap-adjudicate.js → advisories/gap-adjudicate.js} +3 -3
  87. package/lib/{native-package-match.js → advisories/native-package-match.js} +20 -11
  88. package/lib/{native-source-prepare.js → advisories/native-source-prepare.js} +15 -12
  89. package/lib/{native-advisories.js → advisories/native.js} +15 -13
  90. package/lib/{advisory-store-sqlite.js → advisories/store-sqlite.js} +5 -5
  91. package/lib/{advisory-store.js → advisories/store.js} +2 -2
  92. package/lib/{application-exports.js → applications/exports.js} +1 -1
  93. package/lib/{application-inventory.js → applications/inventory.js} +3 -1
  94. package/lib/applications/layout.js +199 -0
  95. package/lib/{application-providers → applications}/live-snapshot.js +10 -10
  96. package/lib/{application-plugins → applications/plugins}/drupal.js +2 -2
  97. package/lib/applications/plugins/ghost.js +36 -0
  98. package/lib/{application-plugins → applications/plugins}/index.js +1 -1
  99. package/lib/{application-plugins → applications/plugins}/prestashop.js +73 -15
  100. package/lib/applications/plugins/redmine.js +24 -0
  101. package/lib/{application-plugins → applications/plugins}/runner.js +89 -59
  102. package/lib/{application-plugins → applications/plugins}/spip.js +4 -4
  103. package/lib/{application-plugins → applications/plugins}/symfony.js +1 -1
  104. package/lib/{application-plugins → applications/plugins}/typo3.js +2 -2
  105. package/lib/{application-plugins → applications/plugins}/wave2-common.js +1 -1
  106. package/lib/{application-plugins → applications/plugins}/wordpress.js +52 -18
  107. package/lib/{application-providers → applications}/snapshot-cache.js +1 -1
  108. package/lib/{cms-snapshot-warm.js → applications/snapshot-warm.js} +21 -8
  109. package/lib/artifacts/access-warnings.js +24 -0
  110. package/lib/artifacts/applications.js +39 -8
  111. package/lib/artifacts/component-scope.js +12 -3
  112. package/lib/artifacts/cve-view.js +8 -5
  113. package/lib/artifacts/disk-wasm.mjs +3 -0
  114. package/lib/artifacts/disk.js +188 -0
  115. package/lib/artifacts/elf-product.js +215 -0
  116. package/lib/artifacts/enrichment.js +31 -17
  117. package/lib/artifacts/go-main-identity.js +135 -36
  118. package/lib/artifacts/go-publisher-advisories.js +4 -3
  119. package/lib/artifacts/image-products.js +181 -0
  120. package/lib/artifacts/index.js +36 -13
  121. package/lib/artifacts/install-version.js +44 -0
  122. package/lib/artifacts/inventory-scope.js +53 -3
  123. package/lib/artifacts/pe-product.js +28 -0
  124. package/lib/artifacts/product-advisories.js +212 -0
  125. package/lib/artifacts/product-catalog.js +67 -0
  126. package/lib/artifacts/release-catalogues.js +149 -0
  127. package/lib/artifacts/release-versions.js +101 -0
  128. package/lib/artifacts/remediation-report.js +1 -1
  129. package/lib/artifacts/report-inventory.js +17 -2
  130. package/lib/artifacts/report-path.js +29 -0
  131. package/lib/artifacts/report.js +85 -32
  132. package/lib/artifacts/retire.js +3 -3
  133. package/lib/artifacts/risk-report.js +12 -8
  134. package/lib/artifacts/sbom.js +33 -4
  135. package/lib/artifacts/scan.js +316 -69
  136. package/lib/artifacts/system-apps.js +98 -0
  137. package/lib/artifacts/system-maintenance.js +101 -0
  138. package/lib/artifacts/system-module-updates.js +104 -0
  139. package/lib/artifacts/system-report.js +232 -0
  140. package/lib/{airgap-project.js → cache/airgap-project.js} +25 -10
  141. package/lib/{cache-archive-sqlite.js → cache/archive.js} +6 -5
  142. package/lib/{cache-db.js → cache/db.js} +1 -1
  143. package/lib/{dump-format.js → cache/dump-format.js} +2 -2
  144. package/lib/{json-cache.js → cache/json.js} +1 -1
  145. package/lib/{proxy-cache.js → cache/proxy-cache.js} +9 -9
  146. package/lib/{proxy-scope.js → cache/proxy-scope.js} +1 -1
  147. package/lib/{record-freshness.js → cache/record-freshness.js} +1 -1
  148. package/lib/{cache-repository.js → cache/repository.js} +1 -1
  149. package/lib/{resource-cache → cache/resource}/engine.js +23 -16
  150. package/lib/{resource-cache → cache/resource}/fs-store.js +2 -2
  151. package/lib/{resource-cache → cache/resource}/sqlite-store.js +3 -3
  152. package/lib/{resource-cache → cache/resource}/validate.js +20 -5
  153. package/lib/{sqlite-driver.js → cache/sqlite-driver.js} +7 -5
  154. package/lib/certs/scan.js +17 -11
  155. package/lib/cli-collect.js +262 -0
  156. package/lib/cli-command-routing.js +30 -13
  157. package/lib/cli-groups.js +1 -1
  158. package/lib/cli-image.js +158 -47
  159. package/lib/cli-project-commands.js +10 -10
  160. package/lib/cli-setup.js +8 -8
  161. package/lib/cli-watch.js +3 -3
  162. package/lib/codecs/binary/elf-metadata.js +6 -0
  163. package/lib/codecs/binary/metadata.js +1 -1
  164. package/lib/codecs/binary/pe-metadata.js +47 -11
  165. package/lib/codecs/binary/scan.js +12 -4
  166. package/lib/codecs/binary.codec.js +1 -1
  167. package/lib/codecs/composer/platform.js +2 -2
  168. package/lib/codecs/composer/registry.js +12 -18
  169. package/lib/codecs/composer.codec.js +6 -5
  170. package/lib/codecs/go/parse.js +1 -1
  171. package/lib/codecs/go/registry.js +7 -7
  172. package/lib/codecs/go.codec.js +2 -2
  173. package/lib/codecs/gradle/parse.js +1 -1
  174. package/lib/codecs/gradle/versionless.js +2 -2
  175. package/lib/codecs/gradle.codec.js +7 -7
  176. package/lib/codecs/index.js +1 -1
  177. package/lib/{maven-airgap.js → codecs/maven/airgap.js} +4 -4
  178. package/lib/{maven-bom.js → codecs/maven/bom.js} +3 -3
  179. package/lib/codecs/maven/jar-scan.js +4 -4
  180. package/lib/{maven-license.js → codecs/maven/license.js} +2 -2
  181. package/lib/{core.js → codecs/maven/pom.js} +22 -11
  182. package/lib/{maven-reactor.js → codecs/maven/reactor.js} +18 -12
  183. package/lib/{transitive.js → codecs/maven/transitive.js} +79 -34
  184. package/lib/{maven-version.js → codecs/maven/version.js} +1 -1
  185. package/lib/codecs/maven.codec.js +18 -14
  186. package/lib/codecs/npm/collect.js +55 -8
  187. package/lib/codecs/npm/manifest-kind.js +16 -0
  188. package/lib/codecs/npm/parse.js +23 -7
  189. package/lib/codecs/npm/registry.js +28 -14
  190. package/lib/codecs/npm.codec.js +5 -5
  191. package/lib/codecs/nuget/registry.js +7 -7
  192. package/lib/codecs/nuget.codec.js +4 -4
  193. package/lib/codecs/pypi/registry.js +7 -7
  194. package/lib/codecs/pypi.codec.js +4 -4
  195. package/lib/codecs/recipes.js +2 -2
  196. package/lib/codecs/ruby/registry.js +7 -7
  197. package/lib/codecs/ruby.codec.js +2 -2
  198. package/lib/config.js +1 -1
  199. package/lib/{attribution.js → findings/attribution.js} +3 -3
  200. package/lib/findings/cve-descriptions.js +144 -0
  201. package/lib/{cve-record-coverage.js → findings/cve-record-coverage.js} +46 -41
  202. package/lib/{diff.js → findings/diff.js} +0 -0
  203. package/lib/{finding-enrichment.js → findings/enrichment.js} +45 -32
  204. package/lib/{eu-refs.js → findings/eu-refs.js} +3 -3
  205. package/lib/{gate.js → findings/gate.js} +1 -1
  206. package/lib/{malware.js → findings/malware.js} +30 -7
  207. package/lib/{merge-sources.js → findings/merge.js} +57 -9
  208. package/lib/{priority.js → findings/priority.js} +3 -3
  209. package/lib/findings/risk-evidence.js +24 -0
  210. package/lib/findings/severity.js +16 -0
  211. package/lib/{finding-summary.js → findings/summary.js} +5 -2
  212. package/lib/{suppress.js → findings/suppress.js} +2 -2
  213. package/lib/images/local-docker.js +72 -0
  214. package/lib/{image-network.js → images/network.js} +26 -16
  215. package/lib/{image-references.js → images/references.js} +29 -11
  216. package/lib/{image-registry.js → images/registry.js} +18 -9
  217. package/lib/{source-image-scan.js → images/source-scan.js} +3 -3
  218. package/lib/images/temp-roots.js +23 -0
  219. package/lib/{image-update.js → images/update.js} +3 -3
  220. package/lib/{dep-record.js → inventory/dep-record.js} +2 -2
  221. package/lib/{deps-descriptor.js → inventory/deps-descriptor.js} +3 -3
  222. package/lib/{descriptor-refs.js → inventory/descriptor-refs.js} +1 -1
  223. package/lib/{embedded.js → inventory/embedded.js} +4 -3
  224. package/lib/{license-policy.js → inventory/license-policy.js} +2 -2
  225. package/lib/{manifest-copy.js → inventory/manifest-copy.js} +2 -2
  226. package/lib/{module-names.js → inventory/module-names.js} +1 -1
  227. package/lib/{package-versions.js → inventory/package-versions.js} +2 -2
  228. package/lib/{parallel-walk.js → inventory/parallel-walk.js} +1 -1
  229. package/lib/{path-filter.js → inventory/path-filter.js} +1 -1
  230. package/lib/{private-deps.js → inventory/private-deps.js} +1 -1
  231. package/lib/{project-descriptor.js → inventory/project-descriptor.js} +3 -0
  232. package/lib/{purl.js → inventory/purl.js} +2 -2
  233. package/lib/{unmanaged.js → inventory/unmanaged.js} +6 -3
  234. package/lib/{commercial-support.js → maintenance/commercial-support.js} +5 -5
  235. package/lib/{outdated.js → maintenance/outdated.js} +20 -20
  236. package/lib/options-env.js +1 -1
  237. package/lib/{system-inventory/alpine-tracker.js → providers/alpine/tracker.js} +27 -7
  238. package/lib/{certfr.js → providers/certfr/enrich.js} +9 -9
  239. package/lib/{cve-download.js → providers/cveproject/download.js} +56 -36
  240. package/lib/{cve-legacy-ranges.js → providers/cveproject/legacy-ranges.js} +1 -1
  241. package/lib/{cve-npm-proxy.js → providers/cveproject/npm-proxy.js} +5 -5
  242. package/lib/{cve-packages-proxy.js → providers/cveproject/packages-proxy.js} +6 -6
  243. package/lib/{cve-version-verdict.js → providers/cveproject/version-verdict.js} +2 -2
  244. package/lib/{system-inventory/current-debian.js → providers/debian/current.js} +6 -6
  245. package/lib/{system-inventory/historical-debian.js → providers/debian/historical.js} +6 -6
  246. package/lib/providers/{debian.js → debian/index.js} +1 -0
  247. package/lib/{application-providers/drupal-advisories.js → providers/drupal/advisories.js} +13 -36
  248. package/lib/providers/{drupal.js → drupal/index.js} +4 -0
  249. package/lib/providers/{eol.js → eol/index.js} +1 -1
  250. package/lib/{epss.js → providers/epss/enrich.js} +16 -13
  251. package/lib/providers/{epss.js → epss/index.js} +2 -2
  252. package/lib/{euvd.js → providers/euvd/enrich.js} +13 -13
  253. package/lib/{system-inventory/freexian-ela.js → providers/freexian/ela.js} +6 -6
  254. package/lib/providers/{freexian.js → freexian/index.js} +3 -3
  255. package/lib/{system-inventory/freexian-release-evidence.js → providers/freexian/release-evidence.js} +8 -5
  256. package/lib/{system-inventory/freexian-tracker.js → providers/freexian/tracker.js} +33 -9
  257. package/lib/{gcve-feed.js → providers/gcve/feed.js} +4 -4
  258. package/lib/{gcve.js → providers/gcve/id.js} +1 -1
  259. package/lib/{gcve-index.js → providers/gcve/local-index.js} +4 -4
  260. package/lib/{application-providers/github-advisories.js → providers/github/advisories.js} +6 -2
  261. package/lib/providers/{github.js → github/index.js} +3 -1
  262. package/lib/{github-publisher-maven.js → providers/github/publisher-maven.js} +1 -1
  263. package/lib/providers/{go.js → go/index.js} +1 -1
  264. package/lib/{hash-id.js → providers/hashid/identify.js} +7 -7
  265. package/lib/providers/{hashid.js → hashid/index.js} +1 -1
  266. package/lib/providers/index.js +18 -13
  267. package/lib/{kev.js → providers/kev/enrich.js} +12 -9
  268. package/lib/{maven-cache.js → providers/maven/cache.js} +3 -3
  269. package/lib/providers/{maven.js → maven/index.js} +5 -3
  270. package/lib/{maven-presence.js → providers/maven/presence.js} +5 -5
  271. package/lib/{maven-repo.js → providers/maven/repo.js} +38 -21
  272. package/lib/providers/mit-kerberos/index.js +6 -0
  273. package/lib/{system-inventory/nginx-advisories.js → providers/nginx/advisories.js} +3 -3
  274. package/lib/providers/{npm.js → npm/index.js} +1 -1
  275. package/lib/providers/{nuget.js → nuget/index.js} +1 -1
  276. package/lib/{cpe.js → providers/nvd/cpe.js} +35 -47
  277. package/lib/{nvd.js → providers/nvd/enrich.js} +41 -40
  278. package/lib/providers/{nvd.js → nvd/index.js} +18 -4
  279. package/lib/{nvd-package-ranges.js → providers/nvd/package-ranges.js} +38 -22
  280. package/lib/{osv-db.js → providers/osv/db.js} +18 -16
  281. package/lib/providers/{osv.js → osv/index.js} +1 -1
  282. package/lib/{osv.js → providers/osv/query.js} +150 -80
  283. package/lib/providers/package-releases/index.js +26 -0
  284. package/lib/{packagist-audit.js → providers/packagist/audit.js} +31 -11
  285. package/lib/providers/{packagist.js → packagist/index.js} +1 -1
  286. package/lib/{proxy-throttle.js → providers/proxy-throttle.js} +17 -9
  287. package/lib/providers/{pypi.js → pypi/index.js} +1 -1
  288. package/lib/providers/redhat/bzip2.js +167 -0
  289. package/lib/providers/redhat/errata.js +75 -0
  290. package/lib/providers/redhat/index.js +10 -0
  291. package/lib/providers/redhat/oval.js +70 -0
  292. package/lib/providers/redhat/unfixed.js +127 -0
  293. package/lib/{registries.js → providers/registries.js} +4 -4
  294. package/lib/{retire.js → providers/retire/scan.js} +18 -18
  295. package/lib/providers/{ruby.js → ruby/index.js} +1 -1
  296. package/lib/providers/rubysec/advisories.js +177 -0
  297. package/lib/providers/rubysec/index.js +9 -0
  298. package/lib/{snyk.js → providers/snyk/client.js} +2 -2
  299. package/lib/{application-providers/spip-advisories.js → providers/spip/advisories.js} +5 -13
  300. package/lib/{vigievuln-advisories.js → providers/vigievuln/advisories.js} +4 -4
  301. package/lib/providers/wolfi/index.js +10 -0
  302. package/lib/providers/wolfi/secdb.js +47 -0
  303. package/lib/{application-providers/wordfence-client.js → providers/wordfence/client.js} +4 -4
  304. package/lib/providers/{wordfence.js → wordfence/index.js} +1 -1
  305. package/lib/{application-providers/wordfence-projection.js → providers/wordfence/projection.js} +14 -5
  306. package/lib/{resource-cache/wordfence.js → providers/wordfence/resource-cache.js} +2 -2
  307. package/lib/{application-providers/wordfence-v3.js → providers/wordfence/v3.js} +4 -5
  308. package/lib/providers/{wordpress.js → wordpress/index.js} +5 -0
  309. package/lib/providers/wpvulnerability/assess.js +181 -0
  310. package/lib/providers/wpvulnerability/index.js +12 -0
  311. package/lib/{charts.js → reports/charts.js} +25 -18
  312. package/lib/{csaf-export.js → reports/csaf-export.js} +16 -11
  313. package/lib/{cve-report.js → reports/cve-report.js} +453 -228
  314. package/lib/reports/detail.js +55 -0
  315. package/lib/{i18n.js → reports/i18n.js} +38 -2
  316. package/lib/{report-integrity.js → reports/integrity.js} +1 -1
  317. package/lib/{json-export.js → reports/json-export.js} +95 -24
  318. package/lib/{report-notices.js → reports/notices.js} +11 -6
  319. package/lib/{sarif-export.js → reports/sarif-export.js} +15 -10
  320. package/lib/{sbom-export.js → reports/sbom-export.js} +16 -11
  321. package/lib/{scan-completeness.js → scan/completeness.js} +1 -1
  322. package/lib/scan/coverage.js +114 -0
  323. package/lib/{provenance.js → scan/provenance.js} +12 -5
  324. package/lib/scan/reliability.js +157 -0
  325. package/lib/{source-health.js → scan/source-health.js} +52 -20
  326. package/lib/{source-profile.js → scan/source-profile.js} +3 -3
  327. package/lib/{hosted-proxy.js → service/hosted-proxy.js} +3 -3
  328. package/lib/{project-client.js → service/project-client.js} +20 -2
  329. package/lib/source-input.js +58 -0
  330. package/lib/system-inventory/advisories.js +89 -16
  331. package/lib/system-inventory/collect.js +33 -10
  332. package/lib/system-inventory/distribution-sources.js +32 -15
  333. package/lib/system-inventory/package-applicability.js +51 -0
  334. package/lib/system-inventory/targeted.js +8 -5
  335. package/lib/ui.js +11 -0
  336. package/package.json +49 -2
  337. package/vigievuln.js +483 -352
  338. package/lib/cache-archive.js +0 -676
  339. package/lib/osv-legacy.js +0 -57
  340. package/lib/risk-evidence.js +0 -18
  341. package/lib/scan-coverage.js +0 -61
  342. /package/lib/{application-plugins → applications/plugins}/joomla.js +0 -0
  343. /package/lib/{application-plugins → applications/plugins}/laravel.js +0 -0
  344. /package/lib/{application-plugins → applications/plugins}/magento.js +0 -0
  345. /package/lib/{application-plugins → applications/plugins}/plugin.interface.js +0 -0
  346. /package/lib/{application-plugins → applications/plugins}/select.js +0 -0
  347. /package/lib/{advisory-compression.js → cache/advisory-compression.js} +0 -0
  348. /package/lib/{compression-dictionary.js → cache/compression-dictionary.js} +0 -0
  349. /package/lib/{cache-directory.js → cache/directory.js} +0 -0
  350. /package/lib/{cache-policy.js → cache/policy.js} +0 -0
  351. /package/lib/{resource-cache → cache/resource}/snapshot-projection.js +0 -0
  352. /package/lib/{cache-startup.js → cache/startup.js} +0 -0
  353. /package/lib/{ruby-version.js → codecs/ruby/version.js} +0 -0
  354. /package/lib/{applicability-evidence.js → findings/applicability-evidence.js} +0 -0
  355. /package/lib/{line-stream.js → inventory/line-stream.js} +0 -0
  356. /package/lib/{package-metadata.js → inventory/package-metadata.js} +0 -0
  357. /package/lib/providers/{alpine.js → alpine/index.js} +0 -0
  358. /package/lib/providers/{certfr.js → certfr/index.js} +0 -0
  359. /package/lib/{native-cna-identities.js → providers/cveproject/cna-identities.js} +0 -0
  360. /package/lib/providers/{euvd.js → euvd/index.js} +0 -0
  361. /package/lib/providers/{gcve.js → gcve/index.js} +0 -0
  362. /package/lib/providers/{kev.js → kev/index.js} +0 -0
  363. /package/lib/providers/{nginx.js → nginx/index.js} +0 -0
  364. /package/lib/{nvd-bulk.js → providers/nvd/bulk.js} +0 -0
  365. /package/lib/providers/{osvdb.js → osvdb/index.js} +0 -0
  366. /package/lib/{request-failure.js → providers/request-failure.js} +0 -0
  367. /package/lib/providers/{retire.js → retire/index.js} +0 -0
  368. /package/lib/providers/{vigievuln.js → vigievuln/index.js} +0 -0
  369. /package/lib/{application-providers/wp-checksums.js → providers/wordpress/checksums.js} +0 -0
  370. /package/lib/{report-time.js → reports/time.js} +0 -0
  371. /package/lib/{xlsx-export.js → reports/xlsx-export.js} +0 -0
  372. /package/lib/{diagnostics.js → scan/diagnostics.js} +0 -0
  373. /package/lib/{account-client.js → service/account-client.js} +0 -0
  374. /package/lib/{account-session.js → service/account-session.js} +0 -0
  375. /package/lib/{account-terms.js → service/account-terms.js} +0 -0
@@ -0,0 +1,181 @@
1
+ 'use strict';
2
+
3
+ // Public component API: https://docs.wpvulnerability.com/openapi.yaml
4
+ const crypto = require('node:crypto');
5
+ const path = require('node:path');
6
+ const {compareWordPressVersions: compare} = require('../wordfence/v3');
7
+ const {getResource, hasHostedProxy} = require('..');
8
+ const {responseFetchedAt} = require('../common');
9
+ const snapshots = require('../../applications/snapshot-cache');
10
+ const TTL = 4 * 3600000;
11
+ const hash = value => crypto.createHash('sha256').update(value).digest('hex');
12
+ const object = v => v && typeof v === 'object' && !Array.isArray(v);
13
+ const operators = {lt: n => n < 0, le: n => n <= 0, eq: n => n === 0,
14
+ ne: n => n !== 0, gt: n => n > 0, ge: n => n >= 0};
15
+
16
+ function validate(body, query) {
17
+ const data = body?.data;
18
+ if (!object(body) || body.error !== 0 || !object(data) || data[query.kind] !== query.subject ||
19
+ !(data.vulnerability === null || Array.isArray(data.vulnerability)))
20
+ throw Error('WPVulnerability returned an error, malformed response or mismatched component');
21
+ for (const row of data.vulnerability || []) {
22
+ if (!object(row) || typeof row.uuid !== 'string' || !row.uuid || !Array.isArray(row.source) || !row.source.length ||
23
+ row.source.some(s => !object(s) || typeof s.id !== 'string' || !s.id || typeof s.link !== 'string' || !/^https?:\/\//.test(s.link)))
24
+ throw Error('WPVulnerability returned a malformed advisory');
25
+ if (query.kind !== 'core' && !object(row.operator)) throw Error('WPVulnerability advisory has no version conditions');
26
+ }
27
+ if (query.kind !== 'core' && !(data.name === null || typeof data.name === 'string'))
28
+ throw Error('WPVulnerability returned an invalid component name');
29
+ if (data.supplychain !== undefined && (!Array.isArray(data.supplychain) || data.supplychain.some(row =>
30
+ !object(row) || !Number.isSafeInteger(row.audit_id) || !['malicious', 'suspicious', 'cleaned'].includes(row.verdict) ||
31
+ !object(row.affected_versions) || typeof row.wpbeacon_url !== 'string' || !/^https?:\/\//.test(row.wpbeacon_url))))
32
+ throw Error('WPVulnerability returned a malformed supply-chain advisory');
33
+ return data;
34
+ }
35
+
36
+ function affected(version, range) {
37
+ if (!object(range) || compare(version, version) === null) return null;
38
+ const verdicts = [];
39
+ for (const bound of ['min', 'max']) {
40
+ const value = range[bound + '_version'], op = range[bound + '_operator'];
41
+ if (value === null && op === null) continue;
42
+ if (typeof value !== 'string' || !Object.hasOwn(operators, op)) { verdicts.push(null); continue; }
43
+ const n = compare(version, value);
44
+ verdicts.push(n === null ? null : operators[op](n));
45
+ }
46
+ return verdicts.includes(false) ? false : verdicts.includes(null) ? null : true;
47
+ }
48
+
49
+ async function fetchComponent(query, ctx) {
50
+ const key = `wpvulnerability-v1-${query.kind}-${query.subject}.json`;
51
+ const cachedRun = ctx.snapshotCache?.get(key);
52
+ if (cachedRun) return cachedRun;
53
+ const file = ctx.advisoryCacheDir && path.join(ctx.advisoryCacheDir, key);
54
+ let cached;
55
+ if (file && snapshots.exists(file)) {
56
+ cached = JSON.parse(snapshots.read(file, {preferCache: true}).bytes);
57
+ validate(cached, query);
58
+ }
59
+ const now = ctx.now || Date.now();
60
+ const stamp = Date.parse(cached?._fadSnapshot?.collectedAt);
61
+ const fresh = Number.isFinite(stamp) && stamp <= now + 60000 && now - stamp < TTL && !cached?._fadSnapshot?.stale;
62
+ if (ctx.offline) {
63
+ if (!cached) throw Error(`No cached WPVulnerability response for ${query.kind}/${query.subject}`);
64
+ } else if (!cached || !fresh || hasHostedProxy() || require('../../cache/policy').shouldForceUpdate()) {
65
+ const response = await getResource('wpvulnerability', 'advisories', query,
66
+ {fetcher: ctx.fetchImpl || undefined, requestTimeoutMs: 30000, noStore: true,
67
+ forceRefresh:require('../../cache/policy').shouldForceUpdate()});
68
+ if (!response.ok) throw Error(`WPVulnerability ${query.kind}/${query.subject}: HTTP ${response.status}`);
69
+ if (response.headers.get('x-fad-proxy') === 'stale') throw Error('WPVulnerability source refresh failed');
70
+ if (hasHostedProxy()) {
71
+ const fetchedAt = Date.parse(response.headers.get('x-fad-proxy-fetched-at') || '');
72
+ if (!Number.isFinite(fetchedAt) || fetchedAt > now + 60000 || now - fetchedAt >= TTL)
73
+ throw Error('WPVulnerability proxy response has no fresh source timestamp');
74
+ }
75
+ const chunks = []; let size = 0;
76
+ for await (const chunk of response.body) {
77
+ size += chunk.length;
78
+ if (size > 16 * 1024 ** 2) throw Error('WPVulnerability response exceeds 16 MiB');
79
+ chunks.push(chunk);
80
+ }
81
+ const bytes = Buffer.concat(chunks);
82
+ const body = JSON.parse(bytes.toString('utf8'));
83
+ validate(body, query);
84
+ cached = {...body, _fadSnapshot: {collectedAt: new Date(responseFetchedAt(response)).toISOString(),
85
+ sourceUrl: require('./index').build('advisories', query).url,
86
+ sha256: hash(bytes), completeness: 'component-query'}};
87
+ if (file) snapshots.write(file, cached);
88
+ }
89
+ ctx.snapshotCache?.set(key, cached);
90
+ return cached;
91
+ }
92
+
93
+ function findingsFor(row, component, slug, query) {
94
+ // Core responses reuse the same uuid for different CVEs. Source identities,
95
+ // rather than that uuid alone, identify an advisory reproducibly.
96
+ const cves = [...new Set(row.source.map(s => s.id.toUpperCase()).filter(id => /^CVE-\d{4}-\d{4,}$/.test(id)))].sort();
97
+ const advisoryId = 'WPV-' + hash(JSON.stringify([query.kind, query.kind === 'core' ? 'wordpress' : slug,
98
+ row.source.map(s => [s.id, s.link]).sort()])).slice(0, 32);
99
+ const cvss = row.impact?.cvss4 || row.impact?.cvss3 || row.impact?.cvss;
100
+ const score = cvss?.score != null && cvss.score !== '' && Number.isFinite(Number(cvss.score)) ? Number(cvss.score) : null;
101
+ const rating = String(cvss?.severity || '').toUpperCase();
102
+ const severity = ({C:'CRITICAL', H:'HIGH', M:'MEDIUM', L:'LOW', N:'NONE'})[rating] ||
103
+ (['CRITICAL','HIGH','MEDIUM','LOW','NONE'].includes(rating) ? rating : 'UNKNOWN');
104
+ const source = row.source.find(s => s.description) || row.source[0];
105
+ const fix = row.operator?.max_operator === 'lt' && String(row.operator.unfixed) !== '1' ? row.operator.max_version : null;
106
+ return (cves.length ? cves : [advisoryId]).map(id => ({
107
+ findingId: 'fad-advisory-' + hash(`${id}\0${component.id}`).slice(0, 24),
108
+ applicationIds: [component.applicationId], ownerComponentIds: [component.id],
109
+ applicationRelation: 'direct', attributionStatus: 'confirmed', dependencyPaths: [],
110
+ source: 'wpvulnerability', confidence: component.catalogueStatus === 'user-declared' ? 'user-declared' : 'verified',
111
+ advisoryId, dep: {ecosystem:'wordpress', groupId:`wordpress-${component.kind}`, artifactId:slug, name:slug,
112
+ namespace:`wordpress/${component.kind}`, version:component.version, coordKey:`wordpress:${component.kind}:${slug}`,
113
+ scope:'prod', isDev:false, provenance:'application',
114
+ manifestPaths:(component.evidence || []).map(e=>e.path).filter(Boolean).slice(0,1)},
115
+ cve:{id, aliases:[...cves, advisoryId], severity, score, cvssVector:cvss?.vector || null,
116
+ cvssVersion:cvss?.version || null, title:source.name || row.name || null,
117
+ description:source.description || row.description || row.name || '', published:source.date || null,
118
+ cwes:(row.impact?.cwe || []).map(c=>c.cwe).filter(c=>/^CWE-\d+$/.test(c)), fixVersion:fix,
119
+ osvRefs:row.source.map(s=>({url:s.link,type:'WEB'}))},
120
+ }));
121
+ }
122
+
123
+ async function assess(components, ctx) {
124
+ const findings = [], coverage = [], diagnostics = [];
125
+ for (const component of components) {
126
+ const base = {applicationId:component.applicationId, occurrenceId:component.id,
127
+ capability:'advisories', sourceId:'wpvulnerability', expected:1, executed:0};
128
+ const slug = component.kind === 'core' ? 'wordpress' : require('../wordfence/projection').catalogueSlug(component);
129
+ const diagnostic = component.visibility === 'private' ? 'CMS_PRIVATE_COMPONENT' : !component.version ? 'CMS_VERSION_UNKNOWN' :
130
+ !slug || !['core','plugin','theme'].includes(component.kind) ? 'CMS_IDENTITY_UNVERIFIED' : null;
131
+ if (diagnostic) { coverage.push({...base, execution:'not-run', result:'indeterminate', diagnostic}); continue; }
132
+ const query = {kind:component.kind, subject:component.kind === 'core' ? component.version : slug};
133
+ try {
134
+ const snapshot = await fetchComponent(query, ctx), data = validate(snapshot, query);
135
+ if (component.kind !== 'core' && !data.name) {
136
+ coverage.push({...base, executed:1, execution:'not-run', result:'indeterminate',
137
+ diagnostic:'CMS_PROVIDER_COMPONENT_UNKNOWN', sourceSnapshot:snapshot._fadSnapshot});
138
+ continue;
139
+ }
140
+ let uncertain = false, matched = false;
141
+ const rows = [...(data.vulnerability || [])];
142
+ for (const audit of data.supplychain || []) {
143
+ if (audit.verdict === 'suspicious') {
144
+ diagnostics.push({code:'CMS_SUPPLY_CHAIN_REVIEW', applicationId:component.applicationId,
145
+ componentId:component.id, message:`WPVulnerability supply-chain audit requires review: ${audit.wpbeacon_url}`});
146
+ continue;
147
+ }
148
+ rows.push({uuid:`supply-chain-${audit.audit_id}`, name:'Plugin supply-chain compromise',
149
+ operator:audit.affected_versions, source:[{id:`WPV-SC-${audit.audit_id}`, name:'Plugin supply-chain compromise',
150
+ link:audit.wpbeacon_url, date:audit.published_at}]});
151
+ }
152
+ for (const row of rows) {
153
+ const verdict = component.kind === 'core' ? true : affected(component.version, row.operator);
154
+ if (verdict === null) { uncertain = true; continue; }
155
+ if (!verdict) continue;
156
+ matched = true;
157
+ findings.push(...findingsFor(row, component, slug, query));
158
+ }
159
+ coverage.push({...base, executed:1, execution:uncertain ? 'partial' : 'completed',
160
+ result:uncertain ? 'indeterminate' : matched ? 'affected' : 'no-match', sourceSnapshot:snapshot._fadSnapshot,
161
+ ...(uncertain ? {diagnostic:'CMS_VERSION_UNCOMPARABLE'} : {})});
162
+ } catch (error) {
163
+ coverage.push({...base, execution:'failed', result:'indeterminate', diagnostic:'CMS_PROVIDER_FAILED'});
164
+ diagnostics.push({code:'CMS_PROVIDER_FAILED', applicationId:component.applicationId,
165
+ componentId:component.id, sourceId:'wpvulnerability', message:error.message});
166
+ }
167
+ }
168
+ const unique = new Map();
169
+ for (const finding of findings) {
170
+ const previous = unique.get(finding.findingId);
171
+ if (!previous) unique.set(finding.findingId, finding);
172
+ else previous.cve.osvRefs = [...new Map([...previous.cve.osvRefs, ...finding.cve.osvRefs].map(r=>[r.url,r])).values()];
173
+ }
174
+ return {findings:[...unique.values()], coverage, diagnostics};
175
+ }
176
+
177
+ function publicComponentQueries(components) {
178
+ return require('../wordfence/projection').componentQueries(components);
179
+ }
180
+
181
+ module.exports = {validate, affected, fetchComponent, assess, publicComponentQueries};
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ const subject = /^[a-z0-9][a-z0-9._-]{0,199}$/;
4
+ module.exports = {
5
+ id: 'wpvulnerability', ttlMs: 4 * 3600000,
6
+ build(type, params) {
7
+ if (type !== 'advisories' || !['core', 'plugin', 'theme'].includes(params?.kind) ||
8
+ typeof params.subject !== 'string' || !subject.test(params.subject))
9
+ throw Error('invalid WPVulnerability component identity');
10
+ return {url: `https://www.wpvulnerability.net/${params.kind}/${params.subject}/`, init: {redirect: 'error'}};
11
+ },
12
+ };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * lib/charts.js — compact, dependency-free SVG charts for the HTML report's
2
+ * lib/reports/charts.js — compact, dependency-free SVG charts for the HTML report's
3
3
  * "Overview" row (rendered right under the summary totals).
4
4
  *
5
5
  * Why hand-rolled inline SVG (not <canvas>, not a chart lib, not pure-CSS):
@@ -24,10 +24,10 @@
24
24
  * @author: N.BRAUN
25
25
  * @email: pp9ping@gmail.com
26
26
  */
27
- const { computePriority } = require("./priority");
27
+ const { computePriority } = require("../findings/priority");
28
28
 
29
29
  const CWE_NAMES = (() => {
30
- try { const raw = { ...require("../data/cwe-names.json") }; delete raw._comment; return raw; }
30
+ try { const raw = { ...require("../../data/cwe-names.json") }; delete raw._comment; return raw; }
31
31
  catch { return {}; }
32
32
  })();
33
33
  const cweName = id => CWE_NAMES[String(id || "").toUpperCase()] || "";
@@ -141,7 +141,7 @@ function findingsByImage(matches, artifacts = [], { topN = 7, t = EN_T } = {}) {
141
141
 
142
142
  /** Group each finding by image, application or module; show shared owners
143
143
  * together and retain unknown ownership in an unattributed group. */
144
- function findingsByComponent(matches, { artifacts = [], applications = [], moduleNames = new Map(), topN = 7, t = EN_T } = {}) {
144
+ function findingsByComponent(matches, { host = false, artifacts = [], applications = [], moduleNames = new Map(), topN = 7, t = EN_T } = {}) {
145
145
  const images = new Map(artifacts.map(a => [a.id, a]));
146
146
  const apps = new Map(applications.map(a => [a.id, a]));
147
147
  const groups = new Map(), occurrences = [], indexed = new Map();
@@ -160,7 +160,10 @@ function findingsByComponent(matches, { artifacts = [], applications = [], modul
160
160
  for (const m of occurrences) {
161
161
  const artifact = m.dep?.artifactTargetId;
162
162
  let key, label;
163
- if (artifact) {
163
+ if (host) {
164
+ label = m.dep?.artifactId || m.dep?.name || m.dep?.coordKey || t("Unknown");
165
+ key = JSON.stringify([artifact, m.dep?.ecosystem, label]);
166
+ } else if (artifact) {
164
167
  const meta = images.get(artifact)?.metadata || {};
165
168
  const source = meta.acquisition?.reference || meta.registryReference?.reference || meta.tags?.[0] || meta.source || artifact;
166
169
  const platform = meta.platform && typeof meta.platform === 'object' ? [meta.platform.os, meta.platform.architecture, meta.platform.variant].filter(Boolean).join('/') : meta.platform;
@@ -278,7 +281,7 @@ const MAJOR_SEVERITIES = new Set(["critical", "high"]);
278
281
  * ship it — so the slice total is component-affecting findings, not distinct CVEs.
279
282
  * A match with no attributed manifest is skipped rather than charted as a phantom module.
280
283
  *
281
- * @param {Map<string,string>} moduleNames absolute descriptor path → label (lib/module-names.js)
284
+ * @param {Map<string,string>} moduleNames absolute descriptor path → label (lib/inventory/module-names.js)
282
285
  */
283
286
  function mostVulnerableComponents(prodMatches, moduleNames, { topN = 7, t = EN_T } = {}) {
284
287
  const by = new Map(), seen = new Map();
@@ -498,10 +501,10 @@ function renderChartsGroup(payload = {}, opts = {}) {
498
501
  // CWE distribution; the component chart includes all production findings.
499
502
  const applications = payload.applications || [];
500
503
  const appScan = applications.length > 0;
501
- const cweInput = appScan ? sourceMatches.filter(m => m.applicationRelation === "direct" || (!m.applicationIds?.length && m.dep?.scope !== 'transitive')).concat(imageMatches)
504
+ const cweInput = payload.includeAllProjectFindings ? prod : appScan ? sourceMatches.filter(m => m.applicationRelation === "direct" || (!m.applicationIds?.length && m.dep?.scope !== 'transitive')).concat(imageMatches)
502
505
  : sourceMatches.filter(m => m.dep?.scope !== 'transitive').concat(imageMatches);
503
- const cwe = cweByCriticality(cweInput, { t, cweTitle, includeTransitive: hasImages });
504
- const subs = findingsByComponent(prod, { artifacts: payload.artifacts || [], applications, moduleNames: payload.moduleNames instanceof Map ? payload.moduleNames : new Map(), t });
506
+ const cwe = cweByCriticality(cweInput, { t, cweTitle, includeTransitive: hasImages || payload.includeAllProjectFindings });
507
+ const subs = findingsByComponent(prod, { host:payload.host, artifacts: payload.artifacts || [], applications, moduleNames: payload.moduleNames instanceof Map ? payload.moduleNames : new Map(), t });
505
508
  const unattr = 0;
506
509
  const scope = directVsTransitive(sourceMatches, t);
507
510
  const prio = fixPriority(prod, t);
@@ -518,6 +521,7 @@ function renderChartsGroup(payload = {}, opts = {}) {
518
521
  if (!hasImages && !payload.showEmpty && !(cwe.length || subs.length || scope.length || prio.length || unattr || components.length || (appChart && appChart.rows.length))) return "";
519
522
 
520
523
  const interactive = opts.interactive !== false; // copy button only in the interactive HTML
524
+ const emptyFindings = t(payload.includeAllProjectFindings ? "No CVE matches." : "No production CVE.");
521
525
 
522
526
  const imageSeverity = SEV_SERIES.map(s => ({ ...s, label:t(s.label), value:imageMatches.filter(m => sevKey(m) === s.key).length })).filter(s => s.value);
523
527
  const moduleUnique = new Set(sourceMatches.filter(m => MAJOR_SEVERITIES.has(sevKey(m)) && (m.dep?.manifestPaths || []).some(Boolean)).map(m => m.findingId || m)).size;
@@ -534,7 +538,7 @@ function renderChartsGroup(payload = {}, opts = {}) {
534
538
  const W = Math.max(250, legendBoxWidth(cweSlices), legendBoxWidth(subSlices, note2),
535
539
  legendBoxWidth(imageOnly ? imageSeverity : appChart ? appChart.rows : multiModule ? components : scope), legendBoxWidth(prio));
536
540
 
537
- const cweHeading = hasImages ? t("CWE — findings (by severity)") : t("CWE — direct vulns (by criticality)");
541
+ const cweHeading = hasImages || payload.includeAllProjectFindings ? t("CWE — findings (by severity)") : t("CWE — direct vulns (by criticality)");
538
542
  const card1 = cwe.length
539
543
  ? chartCard({ t, id: "chart-cwe", title: cweHeading, interactive,
540
544
  ...donutChart({ slices: cweSlices, width: W, t }) })
@@ -545,7 +549,7 @@ function renderChartsGroup(payload = {}, opts = {}) {
545
549
  title: t("Findings per component"),
546
550
  interactive, ...donutChart({ slices: subSlices, width: W, note: note2, t }) })
547
551
  : emptyCard("chart-subdeps",
548
- t("Findings per component"), t("No production CVE."));
552
+ t("Findings per component"), emptyFindings);
549
553
 
550
554
  const card3 = imageOnly ? (imageSeverity.length ? chartCard({ t, id: 'chart-image-severity', title:t('Findings by severity'), interactive, ...donutChart({slices:imageSeverity,width:W,t}) }) : emptyCard('chart-image-severity',t('Findings by severity'),t('No production CVE.'))) : appChart
551
555
  ? (appChart.rows.length
@@ -560,11 +564,11 @@ function renderChartsGroup(payload = {}, opts = {}) {
560
564
  : emptyCard("chart-components", t("Most vulnerable components"), t("No critical or high production findings attributed to a project descriptor.")))
561
565
  : (scope.length
562
566
  ? chartCard({ t, id: "chart-scope", title: t("Direct vs transitive (by severity)"), interactive, ...donutChart({ slices: scope, width: W, t }) })
563
- : emptyCard("chart-scope", t("Direct vs transitive (by severity)"), t("No production CVE.")));
567
+ : emptyCard("chart-scope", t("Direct vs transitive (by severity)"), emptyFindings));
564
568
 
565
569
  const card4 = prio.length
566
570
  ? chartCard({ t, id: "chart-priority", title: t("Fix priority"), interactive, ...donutChart({ slices: prio, width: W }) })
567
- : emptyCard("chart-priority", t("Fix priority"), t("No production CVE."));
571
+ : emptyCard("chart-priority", t("Fix priority"), emptyFindings);
568
572
 
569
573
  return `<section class="charts-row" aria-label="${esc(t("Overview charts"))}">${card1}${card2}${card3}${card4}</section>`;
570
574
  }
@@ -576,14 +580,17 @@ function renderCharts(payload = {}, opts = {}) {
576
580
  const source = matches.filter(m => !m.dep?.artifactTargetId);
577
581
  const images = matches.filter(m => !!m.dep?.artifactTargetId);
578
582
  const hasImages = !!payload.hasImages || images.length > 0 || (payload.artifacts || []).length > 0;
579
- const sourceRow = payload.hasSourceProject === false ? "" : renderChartsGroup({...payload, prodMatches:source, artifacts:[], hasImages:false, showEmpty:hasImages && payload.hasSourceProject === true}, opts);
583
+ const sourceRow = payload.hasSourceProject === false ? "" : renderChartsGroup({...payload, prodMatches:source, artifacts:[], hasImages:false, showEmpty:payload.hasSourceProject === true}, opts);
580
584
  const translate = typeof opts.t === 'function' ? opts.t : EN_T;
581
585
  const labelledSource = sourceRow ? `<h2 class="charts-heading">${esc(translate('Project overview'))}</h2>${sourceRow}` : '';
582
- if (!hasImages) return labelledSource;
583
- const imageRow = renderChartsGroup({...payload, prodMatches:images, applications:[], moduleNames:new Map(), descriptorCount:0, hasImages:true}, opts)
586
+ const hostRow = payload.hostMatches ? renderChartsGroup({...payload, prodMatches:payload.hostMatches, artifacts:[], applications:[],
587
+ moduleNames:new Map(), descriptorCount:0, host:true, hasImages:true},opts).replace(/id="chart-/g,'id="host-chart-')
588
+ .replace('aria-label="'+esc(translate('Overview charts'))+'"','aria-label="'+esc(translate('Host overview'))+'"') : '';
589
+ const labelledHost = hostRow ? '<h2 class="charts-heading">'+esc(translate('Host overview'))+'</h2>'+hostRow : '';
590
+ const imageRow = hasImages ? renderChartsGroup({...payload, prodMatches:images, applications:[], moduleNames:new Map(), descriptorCount:0, hasImages:true}, opts)
584
591
  .replace(/id="chart-/g, 'id="image-chart-')
585
- .replace(`aria-label="${esc(translate("Overview charts"))}"`, `aria-label="${esc(translate("Image overview charts"))}"`);
586
- return labelledSource + `<h2 class="charts-heading">${esc(translate('Image overview'))}</h2>` + imageRow;
592
+ .replace(`aria-label="${esc(translate("Overview charts"))}"`, `aria-label="${esc(translate("Image overview charts"))}"`) : '';
593
+ return labelledSource + (imageRow ? `<h2 class="charts-heading">${esc(translate('Image overview'))}</h2>` + imageRow : '') + labelledHost;
587
594
  }
588
595
 
589
596
  module.exports = {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * lib/csaf-export.js — emit a CSAF 2.0 VEX (csaf_vex) document from the resolved
2
+ * lib/reports/csaf-export.js — emit a CSAF 2.0 VEX (csaf_vex) document from the resolved
3
3
  * deps + matches. buildCsaf is pure; writeCsaf writes the JSON to disk.
4
4
  *
5
5
  * Spec: https://docs.oasis-open.org/csaf/csaf/v2.0/csaf-v2.0.html
@@ -8,9 +8,9 @@
8
8
  * @email: pp9ping@gmail.com
9
9
  */
10
10
  const fs = require("fs");
11
- const { purlFor } = require("./purl");
12
- const { variantsFor, matchingVariants } = require("./application-exports");
13
- const { europeanReferences, euvdExploited } = require("./eu-refs");
11
+ const { purlFor } = require("../inventory/purl");
12
+ const { variantsFor, matchingVariants } = require("../applications/exports");
13
+ const { europeanReferences, euvdExploited } = require("../findings/eu-refs");
14
14
 
15
15
  function humanName(dep) {
16
16
  const ns = dep.namespace || dep.groupId || "";
@@ -70,9 +70,14 @@ function buildCsaf(resolvedDeps, cveMatches, opts = {}) {
70
70
 
71
71
  // One vulnerability per CVE, listing every affected product id.
72
72
  const byCve = new Map();
73
+ // An advisory beyond the detail limit on every product it affects keeps its identity,
74
+ // score and product status, not its texts and evidence notes (lib/reports/detail.js).
75
+ const beyond = require('./detail').beyondDetailLimit(cveMatches);
76
+ const detailedIds = new Set((cveMatches || []).filter(m => !beyond.has(m)).map(m => m.cve?.id));
73
77
  for (const m of cveMatches || []) {
74
78
  const id = m.cve?.id;
75
79
  if (!id) continue;
80
+ const compact = !detailedIds.has(id);
76
81
  const entries = productVariantsByCoord.get(m.dep?.coordKey) || [];
77
82
  let pids = matchingVariants(m, entries, projectInfo.src).map(e => e.pid);
78
83
  // A match whose dep isn't in resolvedDeps (e.g. a Snyk-only finding) has no
@@ -96,10 +101,10 @@ function buildCsaf(resolvedDeps, cveMatches, opts = {}) {
96
101
  let v = byCve.get(id);
97
102
  if (!v) {
98
103
  const cve = m.cve;
99
- const risk=require('./risk-evidence'),scoreSafe=!risk.relatedRisk(cve,'scoreSource'),severitySafe=!risk.relatedRisk(cve,'severitySource'),kevRelated=risk.relatedSignal(cve,'kev'),epssRelated=risk.relatedSignal(cve,'epss');
104
+ const risk=require('../findings/risk-evidence'),scoreSafe=!risk.relatedRisk(cve,'scoreSource'),severitySafe=!risk.relatedRisk(cve,'severitySource'),kevRelated=risk.relatedSignal(cve,'kev'),epssRelated=risk.relatedSignal(cve,'epss');
100
105
  const notes = [];
101
- const evidence=risk.evidenceObject(cve);if(Object.keys(evidence).length)notes.push({category:'other',title:'Related risk evidence',text:JSON.stringify(evidence)});
102
- if (cve.description) notes.push({ category: "description", text: cve.description, title: "Description" });
106
+ const evidence=compact ? {} : risk.evidenceObject(cve);if(Object.keys(evidence).length)notes.push({category:'other',title:'Related risk evidence',text:JSON.stringify(evidence)});
107
+ if (cve.description && !compact) notes.push({ category: "description", text: cve.description, title: "Description" });
103
108
  const extras = [];
104
109
  if (cve.epssPercentile != null) extras.push(`${epssRelated ? "Related upstream CVE EPSS percentile" : "EPSS percentile"} ${Math.round(cve.epssPercentile * 100)}%`);
105
110
  if (cve.kev) extras.push(`${kevRelated ? "Related upstream CVE in CISA KEV" : "CISA KEV (known exploited)"}${cve.kevDueDate ? `, remediate by ${cve.kevDueDate}` : ""}`);
@@ -134,11 +139,11 @@ function buildCsaf(resolvedDeps, cveMatches, opts = {}) {
134
139
  };
135
140
  byCve.set(id, v);
136
141
  }
137
- const relatedEvidence=require('./risk-evidence').evidenceObject(m.cve);
142
+ const relatedEvidence=compact ? {} : require('../findings/risk-evidence').evidenceObject(m.cve);
138
143
  if(Object.keys(relatedEvidence).length){const text=JSON.stringify(relatedEvidence);v.notes ||= [];if(!v.notes.some(n=>n.title==='Related risk evidence' && n.text===text))v.notes.push({category:'other',title:'Related risk evidence',text});}
139
- if(m.cve.historicalEvidence){const text=JSON.stringify({products:pids,evidence:m.cve.historicalEvidence});v.notes ||= [];if(!v.notes.some(n=>n.title==='Historical advisory evidence'&&n.text===text))v.notes.push({category:'other',title:'Historical advisory evidence',text});}
140
- for(const evidence of require('./applicability-evidence').applicabilityEvidence(m.cve)){const text=JSON.stringify({products:pids,...evidence});v.notes ||= [];if(!v.notes.some(n=>n.title==='Applicability evidence'&&n.text===text))v.notes.push({category:'other',title:'Applicability evidence',text});}
141
- if(m.cve.vendorEvidence){const text=JSON.stringify({products:pids,evidence:m.cve.vendorEvidence});v.notes ||= [];if(!v.notes.some(n=>n.title==='Vendor advisory evidence'&&n.text===text))v.notes.push({category:'other',title:'Vendor advisory evidence',text});}
144
+ if(m.cve.historicalEvidence && !compact){const text=JSON.stringify({products:pids,evidence:m.cve.historicalEvidence});v.notes ||= [];if(!v.notes.some(n=>n.title==='Historical advisory evidence'&&n.text===text))v.notes.push({category:'other',title:'Historical advisory evidence',text});}
145
+ for(const evidence of compact ? [] : require('../findings/applicability-evidence').applicabilityEvidence(m.cve)){const text=JSON.stringify({products:pids,...evidence});v.notes ||= [];if(!v.notes.some(n=>n.title==='Applicability evidence'&&n.text===text))v.notes.push({category:'other',title:'Applicability evidence',text});}
146
+ if(m.cve.vendorEvidence && !compact){const text=JSON.stringify({products:pids,evidence:m.cve.vendorEvidence});v.notes ||= [];if(!v.notes.some(n=>n.title==='Vendor advisory evidence'&&n.text===text))v.notes.push({category:'other',title:'Vendor advisory evidence',text});}
142
147
  if (id.startsWith("CVE-") && m.advisoryId) {
143
148
  const system_name = String(m.source || "").includes("wordfence-v3") ? "Wordfence" :
144
149
  String(m.source || "").includes("drupal-security-advisories") ? "Drupal Security Advisory" : "Advisory";