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.
- package/CHANGELOG.md +63 -0
- package/README.md +34 -19
- package/completions/vigievuln.bash +14 -3
- package/completions/vigievuln.zsh +11 -8
- package/data/fingerprints/index.js +80 -0
- package/data/fingerprints/interpreters/javascript/bun.json +23 -0
- package/data/fingerprints/interpreters/javascript/deno.json +10 -0
- package/data/fingerprints/interpreters/javascript/electron.json +20 -0
- package/data/fingerprints/interpreters/javascript/gjs.json +8 -0
- package/data/fingerprints/interpreters/javascript/javascriptcore.json +14 -0
- package/data/fingerprints/interpreters/javascript/jscgtk.json +10 -0
- package/data/fingerprints/interpreters/javascript/node.json +26 -0
- package/data/fingerprints/interpreters/javascript/nwjs.json +8 -0
- package/data/fingerprints/interpreters/javascript/webkitgtk.json +10 -0
- package/data/fingerprints/interpreters/javascript/wpewebkit.json +10 -0
- package/data/fingerprints/interpreters/languages/dotnet.json +8 -0
- package/data/fingerprints/interpreters/languages/erlang.json +9 -0
- package/data/fingerprints/interpreters/languages/gawk.json +10 -0
- package/data/fingerprints/interpreters/languages/guile.json +9 -0
- package/data/fingerprints/interpreters/languages/java.json +8 -0
- package/data/fingerprints/interpreters/languages/julia.json +9 -0
- package/data/fingerprints/interpreters/languages/lua.json +11 -0
- package/data/fingerprints/interpreters/languages/luajit.json +10 -0
- package/data/fingerprints/interpreters/languages/perl.json +11 -0
- package/data/fingerprints/interpreters/languages/php.json +22 -0
- package/data/fingerprints/interpreters/languages/powershell.json +17 -0
- package/data/fingerprints/interpreters/languages/pypy.json +8 -0
- package/data/fingerprints/interpreters/languages/python.json +24 -0
- package/data/fingerprints/interpreters/languages/r.json +9 -0
- package/data/fingerprints/interpreters/languages/racket.json +9 -0
- package/data/fingerprints/interpreters/languages/raku.json +8 -0
- package/data/fingerprints/interpreters/languages/ruby.json +21 -0
- package/data/fingerprints/interpreters/languages/tcl.json +9 -0
- package/data/fingerprints/interpreters/shells/bash.json +10 -0
- package/data/fingerprints/interpreters/shells/dash.json +8 -0
- package/data/fingerprints/interpreters/shells/fish.json +9 -0
- package/data/fingerprints/interpreters/shells/ksh.json +8 -0
- package/data/fingerprints/interpreters/shells/zsh.json +9 -0
- package/data/fingerprints/services/databases/clickhouse.json +8 -0
- package/data/fingerprints/services/databases/elasticsearch.json +8 -0
- package/data/fingerprints/services/databases/etcd.json +9 -0
- package/data/fingerprints/services/databases/mariadb.json +9 -0
- package/data/fingerprints/services/databases/memcached.json +9 -0
- package/data/fingerprints/services/databases/mongo.json +8 -0
- package/data/fingerprints/services/databases/mysql.json +9 -0
- package/data/fingerprints/services/databases/opensearch.json +8 -0
- package/data/fingerprints/services/databases/postgres.json +18 -0
- package/data/fingerprints/services/databases/redis.json +9 -0
- package/data/fingerprints/services/databases/valkey.json +8 -0
- package/data/fingerprints/services/dns-directory/bind.json +8 -0
- package/data/fingerprints/services/dns-directory/dnsmasq.json +8 -0
- package/data/fingerprints/services/dns-directory/slapd.json +8 -0
- package/data/fingerprints/services/dns-directory/unbound.json +8 -0
- package/data/fingerprints/services/mail/cyrus.json +8 -0
- package/data/fingerprints/services/mail/dovecot.json +8 -0
- package/data/fingerprints/services/mail/exim.json +9 -0
- package/data/fingerprints/services/mail/opendkim.json +8 -0
- package/data/fingerprints/services/mail/opensmtpd.json +8 -0
- package/data/fingerprints/services/mail/postfix.json +8 -0
- package/data/fingerprints/services/mail/rspamd.json +8 -0
- package/data/fingerprints/services/mail/sendmail.json +8 -0
- package/data/fingerprints/services/messaging/kafka.json +8 -0
- package/data/fingerprints/services/messaging/mosquitto.json +8 -0
- package/data/fingerprints/services/messaging/nats.json +9 -0
- package/data/fingerprints/services/messaging/rabbitmq.json +8 -0
- package/data/fingerprints/services/remote-access/dropbear.json +8 -0
- package/data/fingerprints/services/remote-access/openssh.json +10 -0
- package/data/fingerprints/services/remote-access/proftpd.json +8 -0
- package/data/fingerprints/services/remote-access/samba.json +8 -0
- package/data/fingerprints/services/remote-access/vsftpd.json +8 -0
- package/data/fingerprints/services/web-proxies/apache.json +18 -0
- package/data/fingerprints/services/web-proxies/caddy.json +9 -0
- package/data/fingerprints/services/web-proxies/envoy.json +8 -0
- package/data/fingerprints/services/web-proxies/haproxy.json +10 -0
- package/data/fingerprints/services/web-proxies/lighttpd.json +8 -0
- package/data/fingerprints/services/web-proxies/nginx.json +14 -0
- package/data/fingerprints/services/web-proxies/squid.json +8 -0
- package/data/fingerprints/services/web-proxies/tomcat.json +8 -0
- package/data/fingerprints/services/web-proxies/traefik.json +9 -0
- package/data/fingerprints/services/web-proxies/varnish.json +8 -0
- package/lib/README.md +51 -0
- package/lib/{coverage-diagnostics.js → advisories/coverage-diagnostics.js} +1 -1
- package/lib/{cve-match.js → advisories/cve-match.js} +17 -12
- package/lib/{advisory-fixes.js → advisories/fixes.js} +1 -1
- package/lib/{advisory-freshness.js → advisories/freshness.js} +5 -1
- package/lib/{gap-adjudicate.js → advisories/gap-adjudicate.js} +3 -3
- package/lib/{native-package-match.js → advisories/native-package-match.js} +20 -11
- package/lib/{native-source-prepare.js → advisories/native-source-prepare.js} +15 -12
- package/lib/{native-advisories.js → advisories/native.js} +15 -13
- package/lib/{advisory-store-sqlite.js → advisories/store-sqlite.js} +5 -5
- package/lib/{advisory-store.js → advisories/store.js} +2 -2
- package/lib/{application-exports.js → applications/exports.js} +1 -1
- package/lib/{application-inventory.js → applications/inventory.js} +3 -1
- package/lib/applications/layout.js +199 -0
- package/lib/{application-providers → applications}/live-snapshot.js +10 -10
- package/lib/{application-plugins → applications/plugins}/drupal.js +2 -2
- package/lib/applications/plugins/ghost.js +36 -0
- package/lib/{application-plugins → applications/plugins}/index.js +1 -1
- package/lib/{application-plugins → applications/plugins}/prestashop.js +73 -15
- package/lib/applications/plugins/redmine.js +24 -0
- package/lib/{application-plugins → applications/plugins}/runner.js +89 -59
- package/lib/{application-plugins → applications/plugins}/spip.js +4 -4
- package/lib/{application-plugins → applications/plugins}/symfony.js +1 -1
- package/lib/{application-plugins → applications/plugins}/typo3.js +2 -2
- package/lib/{application-plugins → applications/plugins}/wave2-common.js +1 -1
- package/lib/{application-plugins → applications/plugins}/wordpress.js +52 -18
- package/lib/{application-providers → applications}/snapshot-cache.js +1 -1
- package/lib/{cms-snapshot-warm.js → applications/snapshot-warm.js} +21 -8
- package/lib/artifacts/access-warnings.js +24 -0
- package/lib/artifacts/applications.js +39 -8
- package/lib/artifacts/component-scope.js +12 -3
- package/lib/artifacts/cve-view.js +8 -5
- package/lib/artifacts/disk-wasm.mjs +3 -0
- package/lib/artifacts/disk.js +188 -0
- package/lib/artifacts/elf-product.js +215 -0
- package/lib/artifacts/enrichment.js +31 -17
- package/lib/artifacts/go-main-identity.js +135 -36
- package/lib/artifacts/go-publisher-advisories.js +4 -3
- package/lib/artifacts/image-products.js +181 -0
- package/lib/artifacts/index.js +36 -13
- package/lib/artifacts/install-version.js +44 -0
- package/lib/artifacts/inventory-scope.js +53 -3
- package/lib/artifacts/pe-product.js +28 -0
- package/lib/artifacts/product-advisories.js +212 -0
- package/lib/artifacts/product-catalog.js +67 -0
- package/lib/artifacts/release-catalogues.js +149 -0
- package/lib/artifacts/release-versions.js +101 -0
- package/lib/artifacts/remediation-report.js +1 -1
- package/lib/artifacts/report-inventory.js +17 -2
- package/lib/artifacts/report-path.js +29 -0
- package/lib/artifacts/report.js +85 -32
- package/lib/artifacts/retire.js +3 -3
- package/lib/artifacts/risk-report.js +12 -8
- package/lib/artifacts/sbom.js +33 -4
- package/lib/artifacts/scan.js +316 -69
- package/lib/artifacts/system-apps.js +98 -0
- package/lib/artifacts/system-maintenance.js +101 -0
- package/lib/artifacts/system-module-updates.js +104 -0
- package/lib/artifacts/system-report.js +232 -0
- package/lib/{airgap-project.js → cache/airgap-project.js} +25 -10
- package/lib/{cache-archive-sqlite.js → cache/archive.js} +6 -5
- package/lib/{cache-db.js → cache/db.js} +1 -1
- package/lib/{dump-format.js → cache/dump-format.js} +2 -2
- package/lib/{json-cache.js → cache/json.js} +1 -1
- package/lib/{proxy-cache.js → cache/proxy-cache.js} +9 -9
- package/lib/{proxy-scope.js → cache/proxy-scope.js} +1 -1
- package/lib/{record-freshness.js → cache/record-freshness.js} +1 -1
- package/lib/{cache-repository.js → cache/repository.js} +1 -1
- package/lib/{resource-cache → cache/resource}/engine.js +23 -16
- package/lib/{resource-cache → cache/resource}/fs-store.js +2 -2
- package/lib/{resource-cache → cache/resource}/sqlite-store.js +3 -3
- package/lib/{resource-cache → cache/resource}/validate.js +20 -5
- package/lib/{sqlite-driver.js → cache/sqlite-driver.js} +7 -5
- package/lib/certs/scan.js +17 -11
- package/lib/cli-collect.js +262 -0
- package/lib/cli-command-routing.js +30 -13
- package/lib/cli-groups.js +1 -1
- package/lib/cli-image.js +158 -47
- package/lib/cli-project-commands.js +10 -10
- package/lib/cli-setup.js +8 -8
- package/lib/cli-watch.js +3 -3
- package/lib/codecs/binary/elf-metadata.js +6 -0
- package/lib/codecs/binary/metadata.js +1 -1
- package/lib/codecs/binary/pe-metadata.js +47 -11
- package/lib/codecs/binary/scan.js +12 -4
- package/lib/codecs/binary.codec.js +1 -1
- package/lib/codecs/composer/platform.js +2 -2
- package/lib/codecs/composer/registry.js +12 -18
- package/lib/codecs/composer.codec.js +6 -5
- package/lib/codecs/go/parse.js +1 -1
- package/lib/codecs/go/registry.js +7 -7
- package/lib/codecs/go.codec.js +2 -2
- package/lib/codecs/gradle/parse.js +1 -1
- package/lib/codecs/gradle/versionless.js +2 -2
- package/lib/codecs/gradle.codec.js +7 -7
- package/lib/codecs/index.js +1 -1
- package/lib/{maven-airgap.js → codecs/maven/airgap.js} +4 -4
- package/lib/{maven-bom.js → codecs/maven/bom.js} +3 -3
- package/lib/codecs/maven/jar-scan.js +4 -4
- package/lib/{maven-license.js → codecs/maven/license.js} +2 -2
- package/lib/{core.js → codecs/maven/pom.js} +22 -11
- package/lib/{maven-reactor.js → codecs/maven/reactor.js} +18 -12
- package/lib/{transitive.js → codecs/maven/transitive.js} +79 -34
- package/lib/{maven-version.js → codecs/maven/version.js} +1 -1
- package/lib/codecs/maven.codec.js +18 -14
- package/lib/codecs/npm/collect.js +55 -8
- package/lib/codecs/npm/manifest-kind.js +16 -0
- package/lib/codecs/npm/parse.js +23 -7
- package/lib/codecs/npm/registry.js +28 -14
- package/lib/codecs/npm.codec.js +5 -5
- package/lib/codecs/nuget/registry.js +7 -7
- package/lib/codecs/nuget.codec.js +4 -4
- package/lib/codecs/pypi/registry.js +7 -7
- package/lib/codecs/pypi.codec.js +4 -4
- package/lib/codecs/recipes.js +2 -2
- package/lib/codecs/ruby/registry.js +7 -7
- package/lib/codecs/ruby.codec.js +2 -2
- package/lib/config.js +1 -1
- package/lib/{attribution.js → findings/attribution.js} +3 -3
- package/lib/findings/cve-descriptions.js +144 -0
- package/lib/{cve-record-coverage.js → findings/cve-record-coverage.js} +46 -41
- package/lib/{diff.js → findings/diff.js} +0 -0
- package/lib/{finding-enrichment.js → findings/enrichment.js} +45 -32
- package/lib/{eu-refs.js → findings/eu-refs.js} +3 -3
- package/lib/{gate.js → findings/gate.js} +1 -1
- package/lib/{malware.js → findings/malware.js} +30 -7
- package/lib/{merge-sources.js → findings/merge.js} +57 -9
- package/lib/{priority.js → findings/priority.js} +3 -3
- package/lib/findings/risk-evidence.js +24 -0
- package/lib/findings/severity.js +16 -0
- package/lib/{finding-summary.js → findings/summary.js} +5 -2
- package/lib/{suppress.js → findings/suppress.js} +2 -2
- package/lib/images/local-docker.js +72 -0
- package/lib/{image-network.js → images/network.js} +26 -16
- package/lib/{image-references.js → images/references.js} +29 -11
- package/lib/{image-registry.js → images/registry.js} +18 -9
- package/lib/{source-image-scan.js → images/source-scan.js} +3 -3
- package/lib/images/temp-roots.js +23 -0
- package/lib/{image-update.js → images/update.js} +3 -3
- package/lib/{dep-record.js → inventory/dep-record.js} +2 -2
- package/lib/{deps-descriptor.js → inventory/deps-descriptor.js} +3 -3
- package/lib/{descriptor-refs.js → inventory/descriptor-refs.js} +1 -1
- package/lib/{embedded.js → inventory/embedded.js} +4 -3
- package/lib/{license-policy.js → inventory/license-policy.js} +2 -2
- package/lib/{manifest-copy.js → inventory/manifest-copy.js} +2 -2
- package/lib/{module-names.js → inventory/module-names.js} +1 -1
- package/lib/{package-versions.js → inventory/package-versions.js} +2 -2
- package/lib/{parallel-walk.js → inventory/parallel-walk.js} +1 -1
- package/lib/{path-filter.js → inventory/path-filter.js} +1 -1
- package/lib/{private-deps.js → inventory/private-deps.js} +1 -1
- package/lib/{project-descriptor.js → inventory/project-descriptor.js} +3 -0
- package/lib/{purl.js → inventory/purl.js} +2 -2
- package/lib/{unmanaged.js → inventory/unmanaged.js} +6 -3
- package/lib/{commercial-support.js → maintenance/commercial-support.js} +5 -5
- package/lib/{outdated.js → maintenance/outdated.js} +20 -20
- package/lib/options-env.js +1 -1
- package/lib/{system-inventory/alpine-tracker.js → providers/alpine/tracker.js} +27 -7
- package/lib/{certfr.js → providers/certfr/enrich.js} +9 -9
- package/lib/{cve-download.js → providers/cveproject/download.js} +56 -36
- package/lib/{cve-legacy-ranges.js → providers/cveproject/legacy-ranges.js} +1 -1
- package/lib/{cve-npm-proxy.js → providers/cveproject/npm-proxy.js} +5 -5
- package/lib/{cve-packages-proxy.js → providers/cveproject/packages-proxy.js} +6 -6
- package/lib/{cve-version-verdict.js → providers/cveproject/version-verdict.js} +2 -2
- package/lib/{system-inventory/current-debian.js → providers/debian/current.js} +6 -6
- package/lib/{system-inventory/historical-debian.js → providers/debian/historical.js} +6 -6
- package/lib/providers/{debian.js → debian/index.js} +1 -0
- package/lib/{application-providers/drupal-advisories.js → providers/drupal/advisories.js} +13 -36
- package/lib/providers/{drupal.js → drupal/index.js} +4 -0
- package/lib/providers/{eol.js → eol/index.js} +1 -1
- package/lib/{epss.js → providers/epss/enrich.js} +16 -13
- package/lib/providers/{epss.js → epss/index.js} +2 -2
- package/lib/{euvd.js → providers/euvd/enrich.js} +13 -13
- package/lib/{system-inventory/freexian-ela.js → providers/freexian/ela.js} +6 -6
- package/lib/providers/{freexian.js → freexian/index.js} +3 -3
- package/lib/{system-inventory/freexian-release-evidence.js → providers/freexian/release-evidence.js} +8 -5
- package/lib/{system-inventory/freexian-tracker.js → providers/freexian/tracker.js} +33 -9
- package/lib/{gcve-feed.js → providers/gcve/feed.js} +4 -4
- package/lib/{gcve.js → providers/gcve/id.js} +1 -1
- package/lib/{gcve-index.js → providers/gcve/local-index.js} +4 -4
- package/lib/{application-providers/github-advisories.js → providers/github/advisories.js} +6 -2
- package/lib/providers/{github.js → github/index.js} +3 -1
- package/lib/{github-publisher-maven.js → providers/github/publisher-maven.js} +1 -1
- package/lib/providers/{go.js → go/index.js} +1 -1
- package/lib/{hash-id.js → providers/hashid/identify.js} +7 -7
- package/lib/providers/{hashid.js → hashid/index.js} +1 -1
- package/lib/providers/index.js +18 -13
- package/lib/{kev.js → providers/kev/enrich.js} +12 -9
- package/lib/{maven-cache.js → providers/maven/cache.js} +3 -3
- package/lib/providers/{maven.js → maven/index.js} +5 -3
- package/lib/{maven-presence.js → providers/maven/presence.js} +5 -5
- package/lib/{maven-repo.js → providers/maven/repo.js} +38 -21
- package/lib/providers/mit-kerberos/index.js +6 -0
- package/lib/{system-inventory/nginx-advisories.js → providers/nginx/advisories.js} +3 -3
- package/lib/providers/{npm.js → npm/index.js} +1 -1
- package/lib/providers/{nuget.js → nuget/index.js} +1 -1
- package/lib/{cpe.js → providers/nvd/cpe.js} +35 -47
- package/lib/{nvd.js → providers/nvd/enrich.js} +41 -40
- package/lib/providers/{nvd.js → nvd/index.js} +18 -4
- package/lib/{nvd-package-ranges.js → providers/nvd/package-ranges.js} +38 -22
- package/lib/{osv-db.js → providers/osv/db.js} +18 -16
- package/lib/providers/{osv.js → osv/index.js} +1 -1
- package/lib/{osv.js → providers/osv/query.js} +150 -80
- package/lib/providers/package-releases/index.js +26 -0
- package/lib/{packagist-audit.js → providers/packagist/audit.js} +31 -11
- package/lib/providers/{packagist.js → packagist/index.js} +1 -1
- package/lib/{proxy-throttle.js → providers/proxy-throttle.js} +17 -9
- package/lib/providers/{pypi.js → pypi/index.js} +1 -1
- package/lib/providers/redhat/bzip2.js +167 -0
- package/lib/providers/redhat/errata.js +75 -0
- package/lib/providers/redhat/index.js +10 -0
- package/lib/providers/redhat/oval.js +70 -0
- package/lib/providers/redhat/unfixed.js +127 -0
- package/lib/{registries.js → providers/registries.js} +4 -4
- package/lib/{retire.js → providers/retire/scan.js} +18 -18
- package/lib/providers/{ruby.js → ruby/index.js} +1 -1
- package/lib/providers/rubysec/advisories.js +177 -0
- package/lib/providers/rubysec/index.js +9 -0
- package/lib/{snyk.js → providers/snyk/client.js} +2 -2
- package/lib/{application-providers/spip-advisories.js → providers/spip/advisories.js} +5 -13
- package/lib/{vigievuln-advisories.js → providers/vigievuln/advisories.js} +4 -4
- package/lib/providers/wolfi/index.js +10 -0
- package/lib/providers/wolfi/secdb.js +47 -0
- package/lib/{application-providers/wordfence-client.js → providers/wordfence/client.js} +4 -4
- package/lib/providers/{wordfence.js → wordfence/index.js} +1 -1
- package/lib/{application-providers/wordfence-projection.js → providers/wordfence/projection.js} +14 -5
- package/lib/{resource-cache/wordfence.js → providers/wordfence/resource-cache.js} +2 -2
- package/lib/{application-providers/wordfence-v3.js → providers/wordfence/v3.js} +4 -5
- package/lib/providers/{wordpress.js → wordpress/index.js} +5 -0
- package/lib/providers/wpvulnerability/assess.js +181 -0
- package/lib/providers/wpvulnerability/index.js +12 -0
- package/lib/{charts.js → reports/charts.js} +25 -18
- package/lib/{csaf-export.js → reports/csaf-export.js} +16 -11
- package/lib/{cve-report.js → reports/cve-report.js} +453 -228
- package/lib/reports/detail.js +55 -0
- package/lib/{i18n.js → reports/i18n.js} +38 -2
- package/lib/{report-integrity.js → reports/integrity.js} +1 -1
- package/lib/{json-export.js → reports/json-export.js} +95 -24
- package/lib/{report-notices.js → reports/notices.js} +11 -6
- package/lib/{sarif-export.js → reports/sarif-export.js} +15 -10
- package/lib/{sbom-export.js → reports/sbom-export.js} +16 -11
- package/lib/{scan-completeness.js → scan/completeness.js} +1 -1
- package/lib/scan/coverage.js +114 -0
- package/lib/{provenance.js → scan/provenance.js} +12 -5
- package/lib/scan/reliability.js +157 -0
- package/lib/{source-health.js → scan/source-health.js} +52 -20
- package/lib/{source-profile.js → scan/source-profile.js} +3 -3
- package/lib/{hosted-proxy.js → service/hosted-proxy.js} +3 -3
- package/lib/{project-client.js → service/project-client.js} +20 -2
- package/lib/source-input.js +58 -0
- package/lib/system-inventory/advisories.js +89 -16
- package/lib/system-inventory/collect.js +33 -10
- package/lib/system-inventory/distribution-sources.js +32 -15
- package/lib/system-inventory/package-applicability.js +51 -0
- package/lib/system-inventory/targeted.js +8 -5
- package/lib/ui.js +11 -0
- package/package.json +49 -2
- package/vigievuln.js +483 -352
- package/lib/cache-archive.js +0 -676
- package/lib/osv-legacy.js +0 -57
- package/lib/risk-evidence.js +0 -18
- package/lib/scan-coverage.js +0 -61
- /package/lib/{application-plugins → applications/plugins}/joomla.js +0 -0
- /package/lib/{application-plugins → applications/plugins}/laravel.js +0 -0
- /package/lib/{application-plugins → applications/plugins}/magento.js +0 -0
- /package/lib/{application-plugins → applications/plugins}/plugin.interface.js +0 -0
- /package/lib/{application-plugins → applications/plugins}/select.js +0 -0
- /package/lib/{advisory-compression.js → cache/advisory-compression.js} +0 -0
- /package/lib/{compression-dictionary.js → cache/compression-dictionary.js} +0 -0
- /package/lib/{cache-directory.js → cache/directory.js} +0 -0
- /package/lib/{cache-policy.js → cache/policy.js} +0 -0
- /package/lib/{resource-cache → cache/resource}/snapshot-projection.js +0 -0
- /package/lib/{cache-startup.js → cache/startup.js} +0 -0
- /package/lib/{ruby-version.js → codecs/ruby/version.js} +0 -0
- /package/lib/{applicability-evidence.js → findings/applicability-evidence.js} +0 -0
- /package/lib/{line-stream.js → inventory/line-stream.js} +0 -0
- /package/lib/{package-metadata.js → inventory/package-metadata.js} +0 -0
- /package/lib/providers/{alpine.js → alpine/index.js} +0 -0
- /package/lib/providers/{certfr.js → certfr/index.js} +0 -0
- /package/lib/{native-cna-identities.js → providers/cveproject/cna-identities.js} +0 -0
- /package/lib/providers/{euvd.js → euvd/index.js} +0 -0
- /package/lib/providers/{gcve.js → gcve/index.js} +0 -0
- /package/lib/providers/{kev.js → kev/index.js} +0 -0
- /package/lib/providers/{nginx.js → nginx/index.js} +0 -0
- /package/lib/{nvd-bulk.js → providers/nvd/bulk.js} +0 -0
- /package/lib/providers/{osvdb.js → osvdb/index.js} +0 -0
- /package/lib/{request-failure.js → providers/request-failure.js} +0 -0
- /package/lib/providers/{retire.js → retire/index.js} +0 -0
- /package/lib/providers/{vigievuln.js → vigievuln/index.js} +0 -0
- /package/lib/{application-providers/wp-checksums.js → providers/wordpress/checksums.js} +0 -0
- /package/lib/{report-time.js → reports/time.js} +0 -0
- /package/lib/{xlsx-export.js → reports/xlsx-export.js} +0 -0
- /package/lib/{diagnostics.js → scan/diagnostics.js} +0 -0
- /package/lib/{account-client.js → service/account-client.js} +0 -0
- /package/lib/{account-session.js → service/account-session.js} +0 -0
- /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("
|
|
27
|
+
const { computePriority } = require("../findings/priority");
|
|
28
28
|
|
|
29
29
|
const CWE_NAMES = (() => {
|
|
30
|
-
try { const raw = { ...require("
|
|
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 (
|
|
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"),
|
|
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)"),
|
|
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"),
|
|
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:
|
|
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
|
-
|
|
583
|
-
|
|
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("
|
|
12
|
-
const { variantsFor, matchingVariants } = require("
|
|
13
|
-
const { europeanReferences, euvdExploited } = require("
|
|
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('
|
|
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('
|
|
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('
|
|
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";
|