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
@@ -5,8 +5,8 @@ const {parseCpe23,matchVersionRange,loadCpeCoordMap}=require('./cpe');
5
5
  // Reuse the native normalizer and version evaluator, including exclusions,
6
6
  // version changes, platform restrictions and disagreement between providers.
7
7
  function projectNvdAffected(record) {
8
- const {extractAffectedRanges}=require('./cve-download');
9
- const {normalizeLegacySplitRanges}=require('./cve-legacy-ranges');
8
+ const {extractAffectedRanges}=require('../cveproject/download');
9
+ const {normalizeLegacySplitRanges}=require('../cveproject/legacy-ranges');
10
10
  if(!record || !/^CVE-\d{4}-\d+$/.test(record.id || '') || /^rejected$/i.test(record.vulnStatus || ''))return null;
11
11
  const affected=[];
12
12
  for(const group of Array.isArray(record.affected) ? record.affected : []) {
@@ -18,8 +18,8 @@ function projectNvdAffected(record) {
18
18
  }
19
19
 
20
20
  function matchNvdAffected(deps,matches,opts={}) {
21
- const {newIndex,addToIndex}=require('./cve-download');
22
- const {matchDepsAgainstCves}=require('./cve-match');
21
+ const {newIndex,addToIndex}=require('../cveproject/download');
22
+ const {matchDepsAgainstCves}=require('../../advisories/cve-match');
23
23
  const index=newIndex(),seen=new Set(),records=new Map();
24
24
  for(const m of matches) {
25
25
  const c=m.cve;
@@ -38,8 +38,25 @@ function matchNvdAffected(deps,matches,opts={}) {
38
38
  // OSV documents independently of whether their ranges match this scan's version.
39
39
  // This allows an older release scanned alone to reuse the same NVD evidence as
40
40
  // it would in a reactor containing a newer release of that package.
41
- function collectPackageNvdBindings(deps,store) {
41
+ function collectPackageNvdBindings(deps,store,findings=[]) {
42
42
  const out=[],seen=new Set();
43
+ // A second record for an already established CVE on every installed version
44
+ // is enrichment. A missing record may affect discovery on another version.
45
+ const found=new Map(),installed=new Map();
46
+ for(const dep of deps.values()){
47
+ if(dep.ecosystem!=='maven'||dep.provenance==='binary')continue;
48
+ const coord=`${dep.groupId}:${dep.artifactId}`;
49
+ if(!installed.has(coord))installed.set(coord,new Set());
50
+ for(const version of dep.versions?.length?dep.versions:[dep.version])installed.get(coord).add(version);
51
+ }
52
+ for(const {dep,cve,cpeFiltered} of findings){
53
+ if(cpeFiltered || dep?.ecosystem!=='maven' || !dep.version)continue;
54
+ const ids=new Set([cve?.id,...cve?.aliases||[]].filter(id=>/^CVE-\d{4}-\d+$/.test(id)));
55
+ if(ids.size!==1)continue;
56
+ const key=JSON.stringify([dep.groupId+':'+dep.artifactId,[...ids][0]]);
57
+ if(!found.has(key))found.set(key,new Set());
58
+ found.get(key).add(dep.version);
59
+ }
43
60
  for(const dep of deps.values()) {
44
61
  if(dep.ecosystem!=='maven' || dep.provenance==='binary')continue;
45
62
  const coord=`${dep.groupId}:${dep.artifactId}`;
@@ -57,6 +74,8 @@ function collectPackageNvdBindings(deps,store) {
57
74
  // affected entry. Do not manufacture a package binding for every alias.
58
75
  if(cves.length!==1 || ids.has(cves[0]))continue;
59
76
  ids.add(cves[0]);
77
+ const confirmed=found.get(JSON.stringify([coord,cves[0]]));
78
+ if(confirmed && [...installed.get(coord)].every(version=>confirmed.has(version)))continue;
60
79
  out.push({dep,source:'osv',bindingOnly:true,cve:{id:cves[0]}});
61
80
  }
62
81
  }
@@ -68,37 +87,34 @@ function collectPackageNvdBindings(deps,store) {
68
87
  // framework products, runtime constraints and negated configurations do not qualify.
69
88
  function matchBoundNvdRanges(deps,matches,map=loadCpeCoordMap()) {
70
89
  const out=[],seen=new Set(matches.filter(m=>!m.bindingOnly).flatMap(m=>[m.cve?.id,...m.cve?.aliases||[]].filter(Boolean).map(id=>`${m.dep?.coordKey}|${m.dep?.version}|${id}`)));
71
- function leaves(node) {
72
- if(!node || node.negate || (node.operator && node.operator!=='OR'))return [];
73
- return [...(node.cpeMatch||[]),...(node.nodes||node.children||[]).flatMap(leaves)];
74
- }
75
90
  for(const match of matches) {
76
91
  if(match.suppressed || match.cpeFiltered || !(match.source||'').split('+').includes('osv'))continue;
77
92
  const {dep,cve}=match;
78
93
  if(dep?.ecosystem!=='maven' || !/^CVE-\d{4}-\d+$/.test(cve?.id||''))continue;
79
94
  const coord=`${dep.groupId}:${dep.artifactId}`;
80
- const ranges=(cve.configurations||[]).flatMap(leaves).filter(r=>{
81
- const c=parseCpe23(r.criteria||r.cpe23Uri);
82
- if(r.vulnerable !== true || !c || c.part!=='a' || c.product!==dep.artifactId)return false;
95
+ const isProduct = leaf => {
96
+ const c=parseCpe23(leaf.criteria||leaf.cpe23Uri);
97
+ if(!c || c.part!=='a' || c.product!==dep.artifactId)return false;
83
98
  const mapping=map.byVendorProduct?.[`${c.vendor}:${c.product}`];
84
- if(mapping?.length!==1 || mapping[0]!==coord)return false;
85
- // Unmodelled CPE qualifiers can restrict applicability to a deployment.
86
- const fields=(r.criteria||r.cpe23Uri).split(':');
87
- if(fields.length!==13 || fields.slice(6).some(x=>x!=='*'))return false;
88
- if(['versionStartIncluding','versionStartExcluding','versionEndIncluding','versionEndExcluding'].some(k=>r[k]!=null && !/^[0-9][A-Za-z0-9._+-]*$/.test(r[k])))return false;
89
- return true;
90
- });
91
- if(!ranges.length)continue;
99
+ return mapping?.length===1 && mapping[0]===coord;
100
+ };
92
101
  for(const d of deps.values()) {
93
102
  if(d.ecosystem!=='maven' || `${d.groupId}:${d.artifactId}`!==coord || d.provenance==='binary')continue;
94
103
  for(const version of d.versions?.length?d.versions:[d.version]) {
95
104
  if(typeof version!=='string' || !/^[0-9][A-Za-z0-9._+-]*$/.test(version))continue;
96
105
  const key=`${d.coordKey}|${version}|${cve.id}`;
97
- if(seen.has(key) || !ranges.some(r=>matchVersionRange(version,r)))continue;
106
+ if(seen.has(key))continue;
107
+ const affected=require('./cpe').evaluateProductConfiguration({nodes:cve.configurations||[]},isProduct,leaf=>{
108
+ const fields=(leaf.criteria||leaf.cpe23Uri).split(':');
109
+ if(fields.length!==13 || !['*','-'].includes(fields[6]) ||
110
+ ['versionStartIncluding','versionStartExcluding','versionEndIncluding','versionEndExcluding'].some(k=>leaf[k]!=null && !/^[0-9][A-Za-z0-9._+-]*$/.test(leaf[k])))return null;
111
+ return matchVersionRange(version,leaf);
112
+ });
113
+ if(affected!==true)continue;
98
114
  seen.add(key);
99
115
  out.push({dep:{...d,version},confidence:'exact',source:'nvd',cve:{
100
116
  id:cve.id,description:cve.description,severity:cve.severity,score:cve.score,
101
- configurations:cve.configurations,fixVersion:null,fixEvaluation:'unknown',
117
+ sourceAdvisoryId:cve.id,nvdRecordEvidence:cve.nvdRecordEvidence,configurations:cve.configurations,fixVersion:null,fixEvaluation:'unknown',
102
118
  identityEvidence:'OSV package binding and unique artifact CPE'
103
119
  }});
104
120
  }
@@ -9,10 +9,10 @@ const fs = require("fs");
9
9
  const path = require("path");
10
10
  const os = require("os");
11
11
  const { unzipSync } = require("fflate");
12
- const { compareMavenVersions } = require("./maven-version");
13
- const { vulnToMatch } = require("./osv");
12
+ const { compareMavenVersions } = require("../../codecs/maven/version");
13
+ const { vulnToMatch } = require("./query");
14
14
 
15
- const OSV_DB_DIR = path.join(require("./cache-directory").getCacheDir(), "osv-db");
15
+ const OSV_DB_DIR = path.join(require("../../cache/directory").getCacheDir(), "osv-db");
16
16
  const BUCKET = "https://osv-vulnerabilities.storage.googleapis.com";
17
17
  const TTL_MS = 4 * 3600 * 1000;
18
18
  // OSV ecosystem export name per fad codec id. Maven only for now (version ordering).
@@ -97,14 +97,14 @@ async function ensureOsvDb(opts = {}) {
97
97
  return index && index.ecosystem === ecoName && index.byPackage && typeof index.byPackage === 'object' && !Array.isArray(index.byPackage) && Number.isFinite(index._builtAt) && index._builtAt > 0 && index._builtAt <= Date.now() + 300000 ? index : null;
98
98
  } catch { return null; } };
99
99
  const loadBest = () => { const a = loadRecords(), b = loadAny(); return a && (!b || a._builtAt >= b._builtAt) ? a : b; };
100
- const loadFresh = () => { const j = loadBest(); return j && require('./cache-policy').fresh(j._builtAt || 0, TTL_MS) ? j : null; };
100
+ const loadFresh = () => { const j = loadBest(); return j && require('../../cache/policy').fresh(j._builtAt || 0, TTL_MS) ? j : null; };
101
101
 
102
102
  if (offline) return loadBest();
103
103
  if (!refresh) { const f = loadFresh(); if (f) return f; }
104
104
  try {
105
105
  // Large ZIP64 upstream exports need the server's streaming validator.
106
106
  if (ecosystem !== 'maven') throw new Error(`direct OSV ${ecoName} import is not supported; import a verified seed`);
107
- const res = await require("./providers").getResource("osvdb", "ecosystem-archive", { ecosystem: ecoName },
107
+ const res = await require("..").getResource("osvdb", "ecosystem-archive", { ecosystem: ecoName },
108
108
  { fetcher, headers: { "User-Agent": "vigievuln-osv-db" } });
109
109
  if (!res || !res.ok) { if (verbose) console.warn(`osv-db: HTTP ${res?.status}`); return loadBest(); }
110
110
  const buf = Buffer.from(await res.arrayBuffer());
@@ -192,12 +192,13 @@ function compareSemver(a, b) {
192
192
 
193
193
  // Three-valued evaluator: unsupported semantics and malformed versions are
194
194
  // unknown, not clean. GIT ranges need a commit graph and are never guessed.
195
- function rangeVerdict(version, range, ecosystem) {
195
+ function rangeVerdict(version, range, ecosystem, compareVersion) {
196
196
  if (!range || !['SEMVER', 'ECOSYSTEM'].includes(range.type) || !Array.isArray(range.events) || !range.events.length) return null;
197
197
  let cmp;
198
198
  if (range.type === 'SEMVER' || ['npm', 'Go'].includes(ecosystem)) cmp = compareSemver;
199
+ else if (compareVersion) cmp = compareVersion;
199
200
  else if (ecosystem === 'Maven') cmp = safeMavenCompare;
200
- else if (ecosystem === 'RubyGems') cmp = require('./ruby-version').compareRubyVersions;
201
+ else if (ecosystem === 'RubyGems') cmp = require('../../codecs/ruby/version').compareRubyVersions;
201
202
  else return null;
202
203
  const v = String(version);
203
204
  // Validate version itself even for an open range introduced at 0.
@@ -237,9 +238,9 @@ function vulnVerdict(version, vuln, ecosystem, opts = {}) {
237
238
  // external OSV documents cannot change OSV's version-list semantics.
238
239
  const partial = opts.source === 'vigievuln' && a.database_specific?.vigievuln_partial_versions === true;
239
240
  if (partial) {
240
- const tested = vulnVerdict(version, {affected:[{versions, ranges:a.ranges || []}]}, ecosystem);
241
+ const tested = vulnVerdict(version, {affected:[{versions, ranges:a.ranges || []}]}, ecosystem, {compareVersion:opts.compareVersion});
241
242
  const knownSafe = Array.isArray(a.database_specific.unaffected_versions)
242
- ? vulnVerdict(version, {affected:[{versions:a.database_specific.unaffected_versions}]}, ecosystem)
243
+ ? vulnVerdict(version, {affected:[{versions:a.database_specific.unaffected_versions}]}, ecosystem, {compareVersion:opts.compareVersion})
243
244
  : false;
244
245
  if (tested === true && knownSafe === true) { unknown = true; continue; }
245
246
  if (tested === true) return true;
@@ -257,21 +258,22 @@ function vulnVerdict(version, vuln, ecosystem, opts = {}) {
257
258
  for (const candidate of versions) {
258
259
  let comparison = null;
259
260
  try {
260
- if (ecosystem === 'Maven') comparison = safeMavenCompare(String(version), String(candidate));
261
+ if (opts.compareVersion) comparison = opts.compareVersion(version,candidate);
262
+ else if (ecosystem === 'Maven') comparison = safeMavenCompare(String(version), String(candidate));
261
263
  else if (['npm', 'Go'].includes(ecosystem)) comparison = compareSemver(version, candidate);
262
- else if (ecosystem === 'RubyGems') comparison = require('./ruby-version').compareRubyVersions(version, candidate);
264
+ else if (ecosystem === 'RubyGems') comparison = require('../../codecs/ruby/version').compareRubyVersions(version, candidate);
263
265
  } catch { /* unknown */ }
264
266
  if (comparison === 0) return true;
265
267
  if (comparison == null) unknown = true;
266
268
  }
267
269
  for (const r of (Array.isArray(a.ranges) ? a.ranges : [])) {
268
- const verdict = rangeVerdict(version, r, ecosystem);
270
+ const verdict = rangeVerdict(version, r, ecosystem, opts.compareVersion);
269
271
  if (verdict === true) return true;
270
272
  if (verdict === null) unknown = true;
271
273
  }
272
274
  // Version spellings outside understood ecosystems can be equivalent even
273
275
  // when the literal strings differ (e.g. PEP 440 1.0 and 1.0.0).
274
- if (!(a.ranges || []).length && versions.length && !['Maven', 'npm', 'Go', 'RubyGems'].includes(ecosystem)) unknown = true;
276
+ if (!(a.ranges || []).length && versions.length && !opts.compareVersion && !['Maven', 'npm', 'Go', 'RubyGems'].includes(ecosystem)) unknown = true;
275
277
  if (!(a.ranges || []).length && !versions.length) unknown = true;
276
278
  }
277
279
  return unknown ? null : false;
@@ -286,7 +288,7 @@ function matchOsvDbDeps(resolvedDeps, index, { onUnknown } = {}) {
286
288
  const out = [];
287
289
  const seen = new Set();
288
290
  const ecoName = index.ecosystem || 'Maven'; // legacy Maven index has no schema
289
- const { osvEcosystemFor, osvPkgName } = require('./osv');
291
+ const { osvEcosystemFor, osvPkgName } = require('./query');
290
292
  for (const dep of resolvedDeps.values()) {
291
293
  if (!Object.hasOwn(ECO, dep.ecosystem === 'yarn' ? 'npm' : dep.ecosystem) || osvEcosystemFor(dep) !== ecoName) continue;
292
294
  if (dep.provenance === "binary") continue;
@@ -321,7 +323,7 @@ function matchOsvDbDeps(resolvedDeps, index, { onUnknown } = {}) {
321
323
  /** Stream seed records; do not publish partial matches if integrity fails. */
322
324
  async function matchOsvDbRecords(resolvedDeps, index, { onUnknown } = {}) {
323
325
  if (!index?.recordsFile || !ECO || !Object.values(ECO).includes(index.ecosystem)) throw new Error('invalid OSV seed');
324
- const { osvEcosystemFor, osvPkgName } = require('./osv');
326
+ const { osvEcosystemFor, osvPkgName } = require('./query');
325
327
  const targets = new Map();
326
328
  for (const dep of resolvedDeps.values()) {
327
329
  if (!dep || !Object.hasOwn(ECO, dep.ecosystem === 'yarn' ? 'npm' : dep.ecosystem) || osvEcosystemFor(dep) !== index.ecosystem || dep.provenance === 'binary') continue;
@@ -332,7 +334,7 @@ async function matchOsvDbRecords(resolvedDeps, index, { onUnknown } = {}) {
332
334
  }
333
335
  const stream = fs.createReadStream(index.recordsFile), hash = require('crypto').createHash('sha256');
334
336
  stream.on('data', chunk => hash.update(chunk));
335
- const lines = require('./line-stream').readTextLines(stream);
337
+ const lines = require('../../inventory/line-stream').readTextLines(stream);
336
338
  const out = [], seen = new Set(), unknown = [], unknownKeys = new Set(); let count = 0;
337
339
  try {
338
340
  for await (const line of lines) {
@@ -1,4 +1,4 @@
1
- const { requestKey } = require("./common");
1
+ const { requestKey } = require("../common");
2
2
  function normalizedQuery(q) {
3
3
  const ecosystem = String(q?.package?.ecosystem || q?.ecosystem || "");
4
4
  const name = String(q?.package?.name || q?.name || "");