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
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* lib/maven
|
|
2
|
+
* lib/providers/maven/repo.js — fan-out HTTP fetcher across the user's configured
|
|
3
3
|
* Maven repositories with Maven Central as a final fallback.
|
|
4
4
|
*
|
|
5
5
|
* Use cases:
|
|
6
|
-
* - Fetching a transitive POM (lib/transitive.js)
|
|
6
|
+
* - Fetching a transitive POM (lib/codecs/maven/transitive.js)
|
|
7
7
|
* - Checking whether an artifact exists at all (HEAD)
|
|
8
8
|
* - Reading <maven-metadata.xml> for latest-version discovery
|
|
9
|
-
* (lib/outdated.js)
|
|
9
|
+
* (lib/maintenance/outdated.js)
|
|
10
10
|
*
|
|
11
11
|
* Repository entry shape (from ~/.fad-checker/config.json or CLI):
|
|
12
12
|
* { name?, url, auth? } auth = "user:pass" (we wrap as Basic <base64>)
|
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
* @email: pp9ping@gmail.com
|
|
23
23
|
*/
|
|
24
24
|
const MAVEN_CENTRAL = { name: "central", url: "https://repo1.maven.org/maven2/", central: true };
|
|
25
|
+
// Different catalogue from Central: last-resort public repository, not a mirror.
|
|
26
|
+
const GOOGLE_MAVEN = { name: "google-android", url: "https://dl.google.com/dl/android/maven2/", fallback: true };
|
|
25
27
|
|
|
26
28
|
/**
|
|
27
29
|
* The mirrors Maven itself lists, and only those:
|
|
@@ -81,11 +83,12 @@ function hashKey(str) {
|
|
|
81
83
|
function orderRepos(repos, key) {
|
|
82
84
|
const list = repos || [];
|
|
83
85
|
if (!key) return list.slice();
|
|
84
|
-
const head = list.filter(r => !r.central);
|
|
86
|
+
const head = list.filter(r => !r.central && !r.fallback);
|
|
85
87
|
const block = list.filter(r => r.central);
|
|
86
|
-
|
|
88
|
+
const tail = list.filter(r => r.fallback && !r.central);
|
|
89
|
+
if (block.length < 2) return [...head, ...block, ...tail];
|
|
87
90
|
const off = hashKey(String(key)) % block.length;
|
|
88
|
-
return [...head, ...block.slice(off), ...block.slice(0, off)];
|
|
91
|
+
return [...head, ...block.slice(off), ...block.slice(0, off), ...tail];
|
|
89
92
|
}
|
|
90
93
|
|
|
91
94
|
function normalise(url) {
|
|
@@ -112,7 +115,7 @@ function splitUrlAuth(url) {
|
|
|
112
115
|
|
|
113
116
|
/**
|
|
114
117
|
* Build the effective repository list: user-configured + extras (from --repo
|
|
115
|
-
* CLI)
|
|
118
|
+
* CLI), Maven Central and its mirrors, then Google Maven. Dedupes by URL.
|
|
116
119
|
*/
|
|
117
120
|
function buildRepoList(userRepos, extraRepos = [], { mirrors = true } = {}) {
|
|
118
121
|
const out = [];
|
|
@@ -123,12 +126,13 @@ function buildRepoList(userRepos, extraRepos = [], { mirrors = true } = {}) {
|
|
|
123
126
|
if (seen.has(url)) return;
|
|
124
127
|
seen.add(url);
|
|
125
128
|
out.push({ name: r.name || url, url, auth: r.auth || auth || null, token: r.token || null,
|
|
126
|
-
central: !!r.central, mirror: !!r.mirror });
|
|
129
|
+
central: !!r.central, mirror: !!r.mirror, ...(r.fallback ? {fallback:true} : {}) });
|
|
127
130
|
};
|
|
128
131
|
for (const r of userRepos || []) push(r);
|
|
129
132
|
for (const r of extraRepos || []) push(r);
|
|
130
133
|
push(MAVEN_CENTRAL);
|
|
131
|
-
if (mirrors && !require('
|
|
134
|
+
if (mirrors && !require('..').hasHostedProxy()) for (const m of DEFAULT_CENTRAL_MIRRORS) push(m);
|
|
135
|
+
push(GOOGLE_MAVEN);
|
|
132
136
|
return out;
|
|
133
137
|
}
|
|
134
138
|
|
|
@@ -174,14 +178,23 @@ async function withDeadline(timeoutMs, fn) {
|
|
|
174
178
|
|
|
175
179
|
async function tryRepos(repos, pathSuffix, opts = {}) {
|
|
176
180
|
const { method = "GET", fetcher = globalThis.fetch, readBody = false, userAgent = "vigievuln-maven-repo", onMiss, timeoutMs = DEFAULT_TIMEOUT_MS, health = defaultRepoHealth, key = null } = opts;
|
|
177
|
-
// Why tracked here and not by lib/source-health.js's fetch guard: these requests carry
|
|
181
|
+
// Why tracked here and not by lib/scan/source-health.js's fetch guard: these requests carry
|
|
178
182
|
// our own AbortSignal, so the guard passes them straight through (it must not retry
|
|
179
183
|
// inside our deadline, nor in front of this failover). Exhausting the rotation without
|
|
180
184
|
// one host answering is the coverage hole, and only this loop knows it happened.
|
|
181
185
|
const misses = [];
|
|
182
186
|
let firstUrl = null;
|
|
183
|
-
|
|
184
|
-
|
|
187
|
+
const ordered = orderRepos(repos,key);
|
|
188
|
+
const structural = method === 'GET' && pathSuffix.endsWith('.pom');
|
|
189
|
+
const available = ordered.filter(repo=>!health?.isDown(repo.url));
|
|
190
|
+
const lastCentral = available.filter(repo=>repo.central).at(-1);
|
|
191
|
+
// HEAD probes can exhaust their mirror list before a required POM is read.
|
|
192
|
+
// Let the final structural lookup use its own retry schedule.
|
|
193
|
+
if (structural && !available.length && ordered.length) available.push(ordered.at(-1));
|
|
194
|
+
const noticeFailover = (repo, reason) => {
|
|
195
|
+
if (structural && repo !== available.at(-1)) require('../../ui').networkNotice(`Maven POM: ${reason}, trying the next mirror.`);
|
|
196
|
+
};
|
|
197
|
+
for (const repo of available) {
|
|
185
198
|
const url = repo.url + pathSuffix.replace(/^\//, "");
|
|
186
199
|
if (!firstUrl) firstUrl = url;
|
|
187
200
|
const headers = { "User-Agent": userAgent };
|
|
@@ -189,16 +202,19 @@ async function tryRepos(repos, pathSuffix, opts = {}) {
|
|
|
189
202
|
if (ah) headers.Authorization = ah;
|
|
190
203
|
let r;
|
|
191
204
|
try {
|
|
192
|
-
const providers = require("
|
|
193
|
-
const official =
|
|
194
|
-
const params = { path: pathSuffix.replace(/^\/+/, ""), method
|
|
195
|
-
|
|
205
|
+
const providers = require("..");
|
|
206
|
+
const official = [MAVEN_CENTRAL.url,GOOGLE_MAVEN.url].includes(repo.url) && !repo.auth && !repo.token;
|
|
207
|
+
const params = { path: pathSuffix.replace(/^\/+/, ""), method,
|
|
208
|
+
...(repo.url===GOOGLE_MAVEN.url ? {repository:'google'} : {}) };
|
|
209
|
+
const lastPom = structural && (repo===available.at(-1) || repo===lastCentral);
|
|
210
|
+
if ((official && providers.hasHostedProxy()) || lastPom) r = await providers.getResource("maven", "artifact", params, {fetcher, headers, requestTimeoutMs:timeoutMs, ...(official ? {} : {urlOverride:url,direct:true})});
|
|
196
211
|
else r = await withDeadline(timeoutMs, signal => providers.getResource("maven", "artifact", params,
|
|
197
212
|
{ fetcher, headers, signal, ...(official ? {} : { urlOverride: url, direct: true }) }));
|
|
198
213
|
} catch (err) {
|
|
199
214
|
// Unreachable or timed out: a mirror that does this once will do it for every
|
|
200
215
|
// remaining coordinate, so take it out of the rotation for the run.
|
|
201
216
|
if (health) health.markDown(repo, err.message);
|
|
217
|
+
noticeFailover(repo, "transport failure");
|
|
202
218
|
misses.push(`network: ${err.message}`);
|
|
203
219
|
if (onMiss) onMiss(repo, `network: ${err.message}`);
|
|
204
220
|
continue;
|
|
@@ -212,11 +228,11 @@ async function tryRepos(repos, pathSuffix, opts = {}) {
|
|
|
212
228
|
}
|
|
213
229
|
// 404 means "this repo does not hold that artifact", which is normal and says nothing
|
|
214
230
|
// about its health. Rate limiting and server errors do: stop asking this mirror.
|
|
215
|
-
if (r.status === 429 || r.status >= 500) { if (health) health.markDown(repo, `HTTP ${r.status}`); }
|
|
231
|
+
if (r.status === 429 || r.status >= 500) { noticeFailover(repo, `HTTP ${r.status}`); if (health) health.markDown(repo, `HTTP ${r.status}`); }
|
|
216
232
|
misses.push(`HTTP ${r.status}`);
|
|
217
233
|
if (onMiss) onMiss(repo, `HTTP ${r.status}`);
|
|
218
234
|
}
|
|
219
|
-
if (firstUrl) require("
|
|
235
|
+
if (firstUrl) require("../../scan/source-health").noteFanoutExhausted(firstUrl, misses);
|
|
220
236
|
return null;
|
|
221
237
|
}
|
|
222
238
|
|
|
@@ -236,9 +252,9 @@ async function reachableRepos(repos, opts = {}) {
|
|
|
236
252
|
const ah = repoAuthHeader(repo);
|
|
237
253
|
if (ah) headers.Authorization = ah;
|
|
238
254
|
try {
|
|
239
|
-
const providers = require("
|
|
240
|
-
if (providers.
|
|
241
|
-
await providers.getResource("maven", "preflight", {}, {fetcher, headers, requestTimeoutMs:timeoutMs});
|
|
255
|
+
const providers = require("..");
|
|
256
|
+
if (providers.hasProxyRoute() && [MAVEN_CENTRAL.url,GOOGLE_MAVEN.url].includes(repo.url) && !repo.auth && !repo.token)
|
|
257
|
+
await providers.getResource("maven", "preflight", repo.url===GOOGLE_MAVEN.url ? {repository:'google'} : {}, {fetcher, headers, requestTimeoutMs:timeoutMs});
|
|
242
258
|
else await withDeadline(timeoutMs, signal => providers.getResource("maven", "preflight", {},
|
|
243
259
|
{ fetcher, headers, signal, urlOverride: repo.url, direct: true }));
|
|
244
260
|
return repo;
|
|
@@ -269,6 +285,7 @@ function fetchMavenMetadata(repos, groupId, artifactId, opts = {}) {
|
|
|
269
285
|
|
|
270
286
|
module.exports = {
|
|
271
287
|
MAVEN_CENTRAL,
|
|
288
|
+
GOOGLE_MAVEN,
|
|
272
289
|
DEFAULT_CENTRAL_MIRRORS,
|
|
273
290
|
orderRepos,
|
|
274
291
|
createRepoHealth,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
module.exports = {id:'mit-kerberos',ttlMs:24*3600000,build(type,params={}) {
|
|
3
|
+
if (type !== 'announcement' || !/^\d{4}q[1-4]$/.test(params.quarter) || !/^\d{6}$/.test(params.message))
|
|
4
|
+
throw Error('Invalid MIT Kerberos announcement');
|
|
5
|
+
return {url:`https://mailman.mit.edu/pipermail/kerberos-announce/${params.quarter}/${params.message}.html`};
|
|
6
|
+
}};
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// Official nginx.org advisory XML; upstream version ranges apply only to
|
|
3
3
|
// packages with an explicitly declared vendor identity, never generic distro builds.
|
|
4
4
|
const crypto=require('node:crypto');
|
|
5
|
-
const {createCacheRepository}=require('
|
|
6
|
-
const {getCacheDir}=require('
|
|
5
|
+
const {createCacheRepository}=require('../../cache/repository');
|
|
6
|
+
const {getCacheDir}=require('../../cache/directory');
|
|
7
7
|
const PARSER_VERSION=2;
|
|
8
8
|
const SOURCE='nginx-vendor-advisories',URL='https://raw.githubusercontent.com/nginx/nginx.org/master/xml/en/security_advisories.xml',PAGE='https://nginx.org/en/security_advisories.html';
|
|
9
9
|
function ver(s){const m=/^(\d+)\.(\d+)\.(\d+)$/.exec(String(s));return m?m.slice(1).map(Number):null;}
|
|
@@ -36,7 +36,7 @@ async function parseNginxAdvisories(input,{maxBytes=4*1024*1024}={}){
|
|
|
36
36
|
if(!records.length)throw Error('NGINX advisory XML has no identified records');return {records,parserVersion:PARSER_VERSION,sha256:crypto.createHash('sha256').update(bytes).digest('hex')};
|
|
37
37
|
}
|
|
38
38
|
async function syncNginxAdvisories(options={}){
|
|
39
|
-
if(options.offline)throw Error('cannot refresh NGINX advisories offline');const timeout=AbortSignal.timeout(options.timeoutMs??30000),signal=options.signal?AbortSignal.any([options.signal,timeout]):timeout;const res=await require('
|
|
39
|
+
if(options.offline)throw Error('cannot refresh NGINX advisories offline');const timeout=AbortSignal.timeout(options.timeoutMs??30000),signal=options.signal?AbortSignal.any([options.signal,timeout]):timeout;const res=await require('..').getResource('nginx','advisories',{}, {fetcher:options.fetcher,signal,streaming:true,noStore:true});if(!res.ok){await res.body?.cancel();throw Error(`NGINX advisory HTTP ${res.status}`);}let size=0,chunks=[];for await(const chunk of res.body){size+=chunk.length;if(size>(options.maxBytes??4*1024*1024))throw Error('NGINX advisory XML exceeds size limit');chunks.push(Buffer.from(chunk));}const parsed=await parseNginxAdvisories(Buffer.concat(chunks),options),now=Date.now(),stamp=Date.parse(res.headers.get('x-fad-proxy-fetched-at')||''),proxy=require('..').hasProxyRoute(),valid=Number.isFinite(stamp)&&stamp>0&&stamp<=now;
|
|
40
40
|
const snapshot={...parsed,sourceURL:URL,observedAt:proxy&&valid?stamp:now,stale:proxy&&(!valid||res.headers.get('x-fad-proxy')==='stale')};(options.cacheRepository||createCacheRepository(options.cacheDir||getCacheDir())).put('catalogue','nginx-advisories',snapshot);return snapshot;
|
|
41
41
|
}
|
|
42
42
|
async function assessNginxAdvisories(packages,options={}){
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const { requestKey } = require("
|
|
1
|
+
const { requestKey } = require("../common");
|
|
2
2
|
module.exports = {
|
|
3
3
|
id: "npm", ttlMs: 24 * 3600 * 1000,
|
|
4
4
|
key(type, params, scope) { return requestKey("npm", type, { name: String(params?.name || "").toLowerCase() }, scope); },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* lib/cpe.js — CPE 2.3 parsing + matching of NVD configuration trees.
|
|
2
|
+
* lib/providers/nvd/cpe.js — CPE 2.3 parsing + matching of NVD configuration trees.
|
|
3
3
|
*
|
|
4
4
|
* CPE 2.3 URI binding:
|
|
5
5
|
* cpe:2.3:part:vendor:product:version:update:edition:language:
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
* @author: N.BRAUN
|
|
19
19
|
* @email: pp9ping@gmail.com
|
|
20
20
|
*/
|
|
21
|
-
const { compareMavenVersions } = require("
|
|
21
|
+
const { compareMavenVersions } = require("../../codecs/maven/version");
|
|
22
22
|
|
|
23
23
|
let CPE_COORD_MAP_CACHE = null;
|
|
24
24
|
function loadCpeCoordMap() {
|
|
25
25
|
if (CPE_COORD_MAP_CACHE) return CPE_COORD_MAP_CACHE;
|
|
26
26
|
try {
|
|
27
|
-
CPE_COORD_MAP_CACHE = require("
|
|
27
|
+
CPE_COORD_MAP_CACHE = require("../../../data/cpe-coord-map.json");
|
|
28
28
|
} catch {
|
|
29
29
|
CPE_COORD_MAP_CACHE = { byVendorProduct: {}, byProduct: {} };
|
|
30
30
|
}
|
|
@@ -128,23 +128,9 @@ function matchVersionRange(depVersion, cpeMatch) {
|
|
|
128
128
|
* Returns true if any vulnerable cpeMatch in the node matches the dep.
|
|
129
129
|
*/
|
|
130
130
|
function nodeAffectsDep(node, dep, cpeCoordMap, opts = {}) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
if (m.vulnerable === false) continue;
|
|
135
|
-
const parsed = parseCpe23Cached(m);
|
|
136
|
-
if (!parsed) continue;
|
|
137
|
-
if (!cpeMatchesDep(parsed, dep, cpeCoordMap, opts)) continue;
|
|
138
|
-
if (!matchVersionRange(dep.version, m)) continue;
|
|
139
|
-
return true;
|
|
140
|
-
}
|
|
141
|
-
// Recurse into children (NVD nests AND/OR nodes)
|
|
142
|
-
if (Array.isArray(node.children)) {
|
|
143
|
-
for (const child of node.children) {
|
|
144
|
-
if (nodeAffectsDep(child, dep, cpeCoordMap, opts)) return true;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
return false;
|
|
131
|
+
return evaluateProductConfiguration(node,
|
|
132
|
+
leaf=>cpeMatchesDep(parseCpe23Cached(leaf),dep,cpeCoordMap,opts),
|
|
133
|
+
leaf=>matchVersionRange(dep.version,leaf)) === true;
|
|
148
134
|
}
|
|
149
135
|
|
|
150
136
|
/**
|
|
@@ -163,7 +149,7 @@ function cveCpeNamesDep(cveRecord, dep, cpeCoordMap) {
|
|
|
163
149
|
const parsed = parseCpe23Cached(m);
|
|
164
150
|
if (parsed && cpeMatchesDep(parsed, dep, map)) return true;
|
|
165
151
|
}
|
|
166
|
-
if (
|
|
152
|
+
if (scan([...(n.children || []),...(n.nodes || [])])) return true;
|
|
167
153
|
}
|
|
168
154
|
return false;
|
|
169
155
|
};
|
|
@@ -172,21 +158,30 @@ function cveCpeNamesDep(cveRecord, dep, cpeCoordMap) {
|
|
|
172
158
|
return false;
|
|
173
159
|
}
|
|
174
160
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
161
|
+
// Evaluate only vulnerable entries identifying the audited product. Other CPEs
|
|
162
|
+
// describe environmental prerequisites, assumed satisfied by scanner policy.
|
|
163
|
+
// A context-only OR branch cannot establish a vulnerability for the product.
|
|
164
|
+
function evaluateProductConfiguration(node, isProduct, versionVerdict) {
|
|
165
|
+
function visit(current) {
|
|
166
|
+
if (!current || !['OR','AND',undefined].includes(current.operator)) return null;
|
|
167
|
+
const values=(current.cpeMatch || current.cpe_match || [])
|
|
168
|
+
.filter(leaf=>leaf.vulnerable===true && isProduct(leaf))
|
|
169
|
+
.map(versionVerdict);
|
|
170
|
+
for (const child of [...(current.nodes || []),...(current.children || [])]) {
|
|
171
|
+
const value=visit(child);
|
|
172
|
+
if(value!==undefined)values.push(value);
|
|
173
|
+
}
|
|
174
|
+
if(!values.length)return undefined;
|
|
175
|
+
if(current.negate)return null;
|
|
176
|
+
return current.operator==='AND'
|
|
177
|
+
? values.includes(false)?false:values.includes(null)?null:true
|
|
178
|
+
: values.includes(true)?true:values.includes(null)?null:false;
|
|
179
|
+
}
|
|
180
|
+
const result=visit(node);
|
|
181
|
+
return result===undefined?false:result;
|
|
188
182
|
}
|
|
189
183
|
|
|
184
|
+
|
|
190
185
|
/**
|
|
191
186
|
* Decide whether a CPE (parsed) refers to the same artifact as a dep.
|
|
192
187
|
* Lookup order:
|
|
@@ -270,21 +265,13 @@ function evaluateCveForDep(cveRecord, dep, cpeCoordMap, opts = {}) {
|
|
|
270
265
|
for (const cfg of configs) {
|
|
271
266
|
const nodes = cfg.nodes || [];
|
|
272
267
|
const op = (cfg.operator || "OR").toUpperCase();
|
|
273
|
-
|
|
274
|
-
if (op === "AND") {
|
|
275
|
-
// AND configs are typically (vulnerable software) AND (platform/runtime
|
|
276
|
-
// context). We assume the library is in use, so context-only nodes are not
|
|
277
|
-
// required — only the vulnerable node(s) must match the dep version. Without
|
|
278
|
-
// this, a "vulnerable:false" platform node makes .every() false and the real
|
|
279
|
-
// finding is wrongly dropped as a CPE false-positive.
|
|
280
|
-
const vulnNodes = nodes.filter(n => !nodeIsContextOnly(n));
|
|
281
|
-
passes = vulnNodes.length > 0 && vulnNodes.every(n => nodeAffectsDep(n, dep, map, opts));
|
|
282
|
-
} else {
|
|
283
|
-
passes = nodes.some(n => nodeAffectsDep(n, dep, map, opts));
|
|
284
|
-
}
|
|
268
|
+
const passes=nodeAffectsDep({...cfg,operator:op},dep,map,opts);
|
|
285
269
|
if (passes) {
|
|
286
270
|
// Determine confidence: scan vulnerable cpeMatches that hit
|
|
287
|
-
|
|
271
|
+
const pending=nodes.slice();
|
|
272
|
+
while(pending.length) {
|
|
273
|
+
const n=pending.pop();
|
|
274
|
+
pending.push(...(n.nodes || []),...(n.children || []));
|
|
288
275
|
for (const m of n.cpeMatch || n.cpe_match || []) {
|
|
289
276
|
if (m.vulnerable === false) continue;
|
|
290
277
|
const parsed = parseCpe23Cached(m);
|
|
@@ -447,6 +434,7 @@ function matchDepsAgainstNvdCpe(resolvedDeps, nvdRecordsById, opts = {}) {
|
|
|
447
434
|
}
|
|
448
435
|
|
|
449
436
|
module.exports = {
|
|
437
|
+
evaluateProductConfiguration,
|
|
450
438
|
parseCpe23,
|
|
451
439
|
matchVersionRange,
|
|
452
440
|
cpeMatchesDep,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* lib/nvd.js — enrich already-found CVEs with the NIST NVD record.
|
|
2
|
+
* lib/providers/nvd/enrich.js — enrich already-found CVEs with the NIST NVD record.
|
|
3
3
|
*
|
|
4
4
|
* NVD's API doesn't expose a Maven-coord index, so we don't use it for
|
|
5
5
|
* recall. Instead we look up each known CVE ID to get the canonical
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
const fs = require("fs");
|
|
18
18
|
const path = require("path");
|
|
19
19
|
const os = require("os");
|
|
20
|
-
const { getNvdApiKey } = require("
|
|
20
|
+
const { getNvdApiKey } = require("../../config");
|
|
21
21
|
|
|
22
|
-
const NVD_CACHE_DIR = path.join(require("
|
|
22
|
+
const NVD_CACHE_DIR = path.join(require("../../cache/directory").getCacheDir(), "nvd-cache");
|
|
23
23
|
const NVD_CACHE_TTL_MS = 4 * 3600 * 1000;
|
|
24
24
|
// Bump whenever `extractFromNvdRecord` adds a new field — pre-bump cache
|
|
25
25
|
// entries are treated as cache-miss so we re-fetch and pick up the new field.
|
|
@@ -48,12 +48,13 @@ function cachePath(cveId) {
|
|
|
48
48
|
|
|
49
49
|
function readCache(cveId, offline = false, cacheDir = path.dirname(NVD_CACHE_DIR), options = {}) {
|
|
50
50
|
try {
|
|
51
|
-
const db=require('
|
|
51
|
+
const db=require('../../cache/db').getCacheDb(cacheDir);
|
|
52
52
|
const row=db.prepare(`SELECT kind,fetched_at,body_deflate,body_bytes,metadata_json FROM nvd_records WHERE cve=?
|
|
53
53
|
${offline ? 'ORDER BY fetched_at DESC LIMIT 1' : "AND kind='live' LIMIT 1"}`).get(cveId);
|
|
54
54
|
if(!row)return null;
|
|
55
|
-
const bytes=require('
|
|
55
|
+
const bytes=require('../../cache/advisory-compression').decompress(row.body_deflate,row.body_bytes);
|
|
56
56
|
const body=JSON.parse(bytes.toString('utf8')),metadata=JSON.parse(row.metadata_json);
|
|
57
|
+
if(body?.cvssVersion==='CVSS:2.0' && Number.isFinite(body.score))body.severity=body.score>=7?'HIGH':body.score>=4?'MEDIUM':'LOW';
|
|
57
58
|
// Offline (air-gapped): the warmed cache is the ONLY source — never reject it
|
|
58
59
|
// for age or an older schema. Dropping it would silently lose ALL NVD
|
|
59
60
|
// enrichment (CWEs, CVSS vector, references, CPE configs) for that CVE, which
|
|
@@ -63,20 +64,20 @@ function readCache(cveId, offline = false, cacheDir = path.dirname(NVD_CACHE_DIR
|
|
|
63
64
|
if (offline) return body;
|
|
64
65
|
// Schema mismatch → force re-fetch so newly-added fields (e.g. cwes) get populated.
|
|
65
66
|
if ((metadata.schema || 1) < NVD_CACHE_SCHEMA) return null;
|
|
66
|
-
const origin=require('
|
|
67
|
+
const origin=require('..').resourceOrigin();
|
|
67
68
|
if (metadata.origin ? metadata.origin !== origin : origin !== 'direct') return null;
|
|
68
|
-
if (!options.forceUpdate && require('
|
|
69
|
-
if (!metadata.stale && row.fetched_at > 0 && row.fetched_at <= Date.now() && require('
|
|
69
|
+
if (!options.forceUpdate && require('../../cache/policy').fresh(row.fetched_at,NVD_CACHE_TTL_MS)) return body;
|
|
70
|
+
if (!metadata.stale && row.fetched_at > 0 && row.fetched_at <= Date.now() && require('../../cache/record-freshness').stableRecord('nvd',body,options)) return body;
|
|
70
71
|
} catch { /* ignore */ }
|
|
71
72
|
return null;
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
function writeCache(cveId, body, fetchedAt = Date.now(), cacheDir = path.dirname(NVD_CACHE_DIR), provenance = {}) {
|
|
75
|
-
const db=require('
|
|
76
|
+
const db=require('../../cache/db').getCacheDb(cacheDir);
|
|
76
77
|
const bytes=Buffer.from(JSON.stringify(body));
|
|
77
78
|
db.prepare(`INSERT INTO nvd_records(cve,kind,fetched_at,revision_ms,body_deflate,body_bytes,metadata_json) VALUES (?,?,?,?,?,?,?)
|
|
78
79
|
ON CONFLICT(cve,kind) DO UPDATE SET fetched_at=excluded.fetched_at,revision_ms=excluded.revision_ms,
|
|
79
|
-
body_deflate=excluded.body_deflate,body_bytes=excluded.body_bytes,metadata_json=excluded.metadata_json`).run(cveId,'live',fetchedAt,null,require('
|
|
80
|
+
body_deflate=excluded.body_deflate,body_bytes=excluded.body_bytes,metadata_json=excluded.metadata_json`).run(cveId,'live',fetchedAt,null,require('../../cache/advisory-compression').compress(bytes),bytes.length,JSON.stringify({schema:NVD_CACHE_SCHEMA,origin:require('..').resourceOrigin(),stale:provenance.stale === true,...(provenance.refreshFailed ? {refreshFailed:true,reason:provenance.reason || 'refresh failed'} : {})}));
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
function responseEvidence(response, status) {
|
|
@@ -93,9 +94,9 @@ function responseEvidence(response, status) {
|
|
|
93
94
|
// cache entry. Keep the distinction when reporting offline coverage.
|
|
94
95
|
function hasCachedAbsence(cveId, options = {}) {
|
|
95
96
|
try {
|
|
96
|
-
const db=require('
|
|
97
|
+
const db=require('../../cache/db').getCacheDb(options.cacheDir || path.dirname(NVD_CACHE_DIR));
|
|
97
98
|
const row=db.prepare('SELECT fetched_at,body_deflate,body_bytes FROM nvd_records WHERE cve=? ORDER BY fetched_at DESC LIMIT 1').get(cveId);
|
|
98
|
-
return !!row && row.fetched_at > 1 && row.fetched_at <= Date.now() && (options.offline || Date.now()-row.fetched_at < NVD_CACHE_TTL_MS) && JSON.parse(require('
|
|
99
|
+
return !!row && row.fetched_at > 1 && row.fetched_at <= Date.now() && (options.offline || Date.now()-row.fetched_at < NVD_CACHE_TTL_MS) && JSON.parse(require('../../cache/advisory-compression').decompress(row.body_deflate,row.body_bytes).toString('utf8')) === null;
|
|
99
100
|
} catch { return false; }
|
|
100
101
|
}
|
|
101
102
|
|
|
@@ -103,13 +104,13 @@ function hasCachedAbsence(cveId, options = {}) {
|
|
|
103
104
|
// changing whether that row is eligible for enrichment.
|
|
104
105
|
function cachedEvidence(cveId, status, opts = {}) {
|
|
105
106
|
try {
|
|
106
|
-
const db = require('
|
|
107
|
+
const db = require('../../cache/db').getCacheDb(opts.cacheDir || path.dirname(NVD_CACHE_DIR));
|
|
107
108
|
const row = db.prepare(`SELECT fetched_at,body_deflate,body_bytes,metadata_json FROM nvd_records WHERE cve=? ${opts.offline ? 'ORDER BY fetched_at DESC LIMIT 1' : "AND kind='live' LIMIT 1"}`).get(cveId);
|
|
108
109
|
if (!row) return { status, stale: false };
|
|
109
110
|
const metadata = JSON.parse(row.metadata_json);
|
|
110
|
-
const body = JSON.parse(require('
|
|
111
|
+
const body = JSON.parse(require('../../cache/advisory-compression').decompress(row.body_deflate, row.body_bytes).toString('utf8'));
|
|
111
112
|
const ageFresh = row.fetched_at > 0 && row.fetched_at <= Date.now() && Date.now() - row.fetched_at < NVD_CACHE_TTL_MS;
|
|
112
|
-
const stale = metadata.stale === true || (!ageFresh && !require('
|
|
113
|
+
const stale = metadata.stale === true || (!ageFresh && !require('../../cache/record-freshness').stableRecord('nvd', body, opts));
|
|
113
114
|
return { status, stale, ...(stale ? { reason: metadata.reason || (opts.offline ? 'offline' : 'stale cached response') } : {}), ...(metadata.refreshFailed === true ? { refreshFailed: true } : {}) };
|
|
114
115
|
} catch { return { status, stale: false }; }
|
|
115
116
|
}
|
|
@@ -127,7 +128,7 @@ function bestMetric(metrics) {
|
|
|
127
128
|
return {
|
|
128
129
|
version: VER[k],
|
|
129
130
|
score: cv.baseScore,
|
|
130
|
-
severity: (cv.baseSeverity || severityFromScore(cv.baseScore) || "UNKNOWN").toUpperCase(),
|
|
131
|
+
severity: (cv.baseSeverity || metrics[k][0].baseSeverity || (k==='cvssMetricV2' && Number.isFinite(cv.baseScore) ? (cv.baseScore>=7?'HIGH':cv.baseScore>=4?'MEDIUM':'LOW') : severityFromScore(cv.baseScore)) || "UNKNOWN").toUpperCase(),
|
|
131
132
|
vector: cv.vectorString,
|
|
132
133
|
};
|
|
133
134
|
}
|
|
@@ -135,14 +136,7 @@ function bestMetric(metrics) {
|
|
|
135
136
|
return null;
|
|
136
137
|
}
|
|
137
138
|
|
|
138
|
-
|
|
139
|
-
if (s == null) return null;
|
|
140
|
-
if (s >= 9) return "CRITICAL";
|
|
141
|
-
if (s >= 7) return "HIGH";
|
|
142
|
-
if (s >= 4) return "MEDIUM";
|
|
143
|
-
if (s > 0) return "LOW";
|
|
144
|
-
return "NONE";
|
|
145
|
-
}
|
|
139
|
+
const { severityFromScore } = require("../../findings/severity");
|
|
146
140
|
|
|
147
141
|
function extractFromNvdRecord(record) {
|
|
148
142
|
if (!record) return null;
|
|
@@ -224,6 +218,8 @@ function sleep(ms) { return new Promise(r => setTimeout(r, ms)); }
|
|
|
224
218
|
const MIRROR_TIMEOUT_MS = 30000;
|
|
225
219
|
const MIRROR_NAME = "fkie-cad/nvd-json-data-feeds";
|
|
226
220
|
const MIRROR_CONCURRENCY = 16;
|
|
221
|
+
// A batch needing more than this many NVD rate windows (4 × 30 s with a key) reads the mirror first.
|
|
222
|
+
const LARGE_BATCH_WINDOWS = 4;
|
|
227
223
|
|
|
228
224
|
/**
|
|
229
225
|
* Read one CVE from the fkie-cad mirror. → { record } (already extracted + cached),
|
|
@@ -234,7 +230,7 @@ const MIRROR_CONCURRENCY = 16;
|
|
|
234
230
|
async function fetchFromMirror(cveId, opts = {}) {
|
|
235
231
|
const { fetcher = globalThis.fetch } = opts;
|
|
236
232
|
try {
|
|
237
|
-
const providers = require("
|
|
233
|
+
const providers = require("..");
|
|
238
234
|
const m = await providers.getResource("nvd", "cve-mirror", { id: cveId },
|
|
239
235
|
{ fetcher, headers: { "User-Agent": "vigievuln-nvd-enrich" }, ...(providers.hasHostedProxy() ? {requestTimeoutMs:MIRROR_TIMEOUT_MS, retryProxyDenied:false, noSourceRetry:true} : {signal:AbortSignal.timeout(MIRROR_TIMEOUT_MS)}) });
|
|
240
236
|
if (m.status === 404) return { absent: true };
|
|
@@ -246,7 +242,7 @@ async function fetchFromMirror(cveId, opts = {}) {
|
|
|
246
242
|
if (!extracted) return { failed: true };
|
|
247
243
|
extracted.via = MIRROR_NAME;
|
|
248
244
|
const evidence = responseEvidence(m, 'available');
|
|
249
|
-
writeCache(cveId, extracted, require('
|
|
245
|
+
writeCache(cveId, extracted, require('../common').responseFetchedAt(m), opts.cacheDir, evidence);
|
|
250
246
|
return { record: extracted, evidence };
|
|
251
247
|
} catch { return { failed: true }; }
|
|
252
248
|
}
|
|
@@ -254,7 +250,7 @@ async function fetchFromMirror(cveId, opts = {}) {
|
|
|
254
250
|
/**
|
|
255
251
|
* One CVE's NVD record. NVD first; when NVD does not ANSWER (throttled 403/429, 5xx, no
|
|
256
252
|
* transport) the same record is read from the fkie-cad git mirror, and only when both fail
|
|
257
|
-
* is the hole reported (lib/source-health.js#noteFanoutExhausted → the run stops before
|
|
253
|
+
* is the hole reported (lib/scan/source-health.js#noteFanoutExhausted → the run stops before
|
|
258
254
|
* writing anything). A definitive NVD 404 is an answer — the CVE is not in NVD — and is
|
|
259
255
|
* never sent to the mirror.
|
|
260
256
|
*
|
|
@@ -278,22 +274,22 @@ async function fetchOne(cveId, opts = {}) {
|
|
|
278
274
|
const key = getNvdApiKey();
|
|
279
275
|
if (key) headers["apiKey"] = key;
|
|
280
276
|
const url = `${NVD_BASE}?cveId=${encodeURIComponent(cveId)}`;
|
|
281
|
-
const providers = require("
|
|
282
|
-
const health = require("
|
|
277
|
+
const providers = require("..");
|
|
278
|
+
const health = require("../../scan/source-health");
|
|
283
279
|
const deadline = () => providers.hasHostedProxy() ? {requestTimeoutMs:MIRROR_TIMEOUT_MS} : (mirror ? { signal: AbortSignal.timeout(MIRROR_TIMEOUT_MS) } : {});
|
|
284
280
|
|
|
285
281
|
let nvdReason;
|
|
286
282
|
try {
|
|
287
|
-
const r = await providers.getResource("nvd", "cve", { id: cveId }, { fetcher, headers, forceRefresh:opts.forceUpdate || require("
|
|
288
|
-
if (r.status === 404) { const evidence = responseEvidence(r,'no-match'); writeCache(cveId, null, require('
|
|
283
|
+
const r = await providers.getResource("nvd", "cve", { id: cveId }, { fetcher, headers, forceRefresh:opts.forceUpdate || require("../../cache/policy").shouldForceUpdate(), ...deadline() });
|
|
284
|
+
if (r.status === 404) { const evidence = responseEvidence(r,'no-match'); writeCache(cveId, null, require('../common').responseFetchedAt(r), opts.cacheDir, evidence); opts.onAbsent?.(cveId); note(evidence); return null; }
|
|
289
285
|
if (r.ok) {
|
|
290
286
|
let data;try { data=await r.json(); } catch { throw Object.assign(new Error('malformed NVD response'),{code:'NVD_INVALID_RESPONSE'}); }
|
|
291
|
-
if (Array.isArray(data?.vulnerabilities) && data.vulnerabilities.length===0 && data.totalResults===0) {const evidence=responseEvidence(r,'no-match');writeCache(cveId,null,require('
|
|
287
|
+
if (Array.isArray(data?.vulnerabilities) && data.vulnerabilities.length===0 && data.totalResults===0) {const evidence=responseEvidence(r,'no-match');writeCache(cveId,null,require('../common').responseFetchedAt(r),opts.cacheDir,evidence);opts.onAbsent?.(cveId);note(evidence);return null;}
|
|
292
288
|
const record=Array.isArray(data?.vulnerabilities) && data.vulnerabilities.length===1 ? data.vulnerabilities[0]?.cve : null;
|
|
293
289
|
if (!record || String(record.id||'').toUpperCase()!==String(cveId).toUpperCase() || (data.totalResults!==undefined && data.totalResults!==1)) throw Object.assign(new Error('malformed NVD response'),{code:'NVD_INVALID_RESPONSE'});
|
|
294
290
|
let extracted;try { extracted=extractFromNvdRecord(record); } catch { throw Object.assign(new Error('malformed NVD response'),{code:'NVD_INVALID_RESPONSE'}); }
|
|
295
291
|
const evidence = responseEvidence(r,'available');
|
|
296
|
-
writeCache(cveId, extracted, require('
|
|
292
|
+
writeCache(cveId, extracted, require('../common').responseFetchedAt(r), opts.cacheDir, evidence);
|
|
297
293
|
note(evidence);
|
|
298
294
|
return extracted;
|
|
299
295
|
}
|
|
@@ -301,7 +297,7 @@ async function fetchOne(cveId, opts = {}) {
|
|
|
301
297
|
} catch (err) {
|
|
302
298
|
nvdReason = err.code==='NVD_INVALID_RESPONSE' ? err.message : `network: ${err.message}`;
|
|
303
299
|
}
|
|
304
|
-
if (verbose) require('
|
|
300
|
+
if (verbose) require('../../ui').networkNotice(` NVD ${nvdReason} for ${cveId}`);
|
|
305
301
|
opts.onFailure?.(cveId,nvdReason);
|
|
306
302
|
// A 4xx we caused (bad request…) is an answer, not an outage: nothing to fall back for.
|
|
307
303
|
if (health.classifyMissReason(nvdReason) === "answered") { note({status:'unavailable',reason:nvdReason,stale:false}); return null; }
|
|
@@ -309,15 +305,15 @@ async function fetchOne(cveId, opts = {}) {
|
|
|
309
305
|
if (mirror) {
|
|
310
306
|
const got = await fetchFromMirror(cveId, { ...opts, fetcher });
|
|
311
307
|
if (got.record) {
|
|
312
|
-
if (verbose) require('
|
|
308
|
+
if (verbose) require('../../ui').networkNotice(` ${cveId} served by the NVD mirror (${MIRROR_NAME})`);
|
|
313
309
|
note(got.evidence);
|
|
314
310
|
return got.record;
|
|
315
311
|
}
|
|
316
312
|
}
|
|
317
|
-
const stale = require("
|
|
313
|
+
const stale = require("..").hasHostedProxy() ? null : readCache(cveId, true, opts.cacheDir);
|
|
318
314
|
if (stale) { note({status:'available',stale:true,refreshFailed:true,reason:nvdReason}); return stale; }
|
|
319
315
|
// Neither NVD nor its mirror produced this record: a coverage hole, reported under NVD.
|
|
320
|
-
health.noteFanoutExhausted(url, [nvdReason], {requestKey:require('
|
|
316
|
+
health.noteFanoutExhausted(url, [nvdReason], {requestKey:require('../common').failureKey('nvd','cve',{id:cveId})});
|
|
321
317
|
note({status:'unavailable',reason:nvdReason,stale:false});
|
|
322
318
|
return null;
|
|
323
319
|
}
|
|
@@ -335,7 +331,7 @@ async function enrichMatches(matches, opts = {}) {
|
|
|
335
331
|
for (const m of matches) if (m.cve?.id?.startsWith("CVE-")) uniqueCves.add(m.cve.id);
|
|
336
332
|
// `opts.hasKey` lets a test pin the key/no-key branch whatever ~/.fad-checker holds.
|
|
337
333
|
const hasKey = opts.hasKey ?? !!getNvdApiKey();
|
|
338
|
-
const hosted = !offline && require("
|
|
334
|
+
const hosted = !offline && require("..").hasHostedProxy();
|
|
339
335
|
const burst = hosted ? 10 : getBurstSize();
|
|
340
336
|
|
|
341
337
|
// Partition cached vs live up-front so the progress display reflects the
|
|
@@ -364,7 +360,11 @@ async function enrichMatches(matches, opts = {}) {
|
|
|
364
360
|
// through the normal paced loop below with NVD's full retry schedule, and a source
|
|
365
361
|
// that still does not answer stops the run (reliability over speed). With a key NVD
|
|
366
362
|
// stays first and the mirror is its fallback (fetchOne).
|
|
367
|
-
|
|
363
|
+
// With a key NVD allows 50 requests per 30 s: fine for a project, about 100 minutes for the
|
|
364
|
+
// 10 000 CVEs of a system with a kernel package. Beyond a few windows of work the mirror
|
|
365
|
+
// goes first as well; NVD then answers only for what the mirror does not hold yet.
|
|
366
|
+
const largeBatch = liveIds.length > burst * LARGE_BATCH_WINDOWS;
|
|
367
|
+
const mirrorFirst = !offline && !require("..").hasHostedProxy() && opts.mirror !== false && (!hasKey || largeBatch) && liveIds.length > 0;
|
|
368
368
|
if (mirrorFirst) {
|
|
369
369
|
const pending = [...liveIds];
|
|
370
370
|
const notMirrored = [];
|
|
@@ -434,6 +434,7 @@ async function enrichMatches(matches, opts = {}) {
|
|
|
434
434
|
if (evidence) m.cve.nvdRecordEvidence = { ...evidence };
|
|
435
435
|
const data = byId.get(m.cve?.id);
|
|
436
436
|
if (!data) continue;
|
|
437
|
+
if (data.id === m.cve.id) m.cve.sourceAdvisoryId ||= data.id;
|
|
437
438
|
// Merge: prefer NVD's official text + CVSS but keep what vigievuln/OSV already has
|
|
438
439
|
// NVD's description is the official long form — prefer it when available.
|
|
439
440
|
if (data.description) {
|
|
@@ -453,7 +454,7 @@ async function enrichMatches(matches, opts = {}) {
|
|
|
453
454
|
if (data.cvssVersion) m.cve.cvssVersion = data.cvssVersion;
|
|
454
455
|
m.cve.nvdRefs = data.references || []; // [{url, tags, source}]
|
|
455
456
|
m.cve.cpes = data.cpes || [];
|
|
456
|
-
m.cve.cwes = data.cwes || [];
|
|
457
|
+
m.cve.cwes = [...new Set([...(m.cve.cwes || []), ...(data.cwes || [])])];
|
|
457
458
|
m.cve.configurations = data.configurations || [];
|
|
458
459
|
m.cve.nvdAffected = data.affected || [];
|
|
459
460
|
m.cve.nvdVulnStatus = data.vulnStatus || null;
|
|
@@ -1,14 +1,28 @@
|
|
|
1
|
-
const { cveId, requestKey } = require("
|
|
1
|
+
const { cveId, requestKey } = require("../common");
|
|
2
2
|
module.exports = {
|
|
3
|
-
id: "nvd", ttlMs: 7 * 24 * 3600 * 1000, revalidateTypes: ['cve','cve-mirror'],
|
|
4
|
-
key(type, params, scope) {
|
|
3
|
+
id: "nvd", ttlMs: 7 * 24 * 3600 * 1000, revalidateTypes: ['cve','cve-mirror','image-product'],
|
|
4
|
+
key(type, params, scope) {
|
|
5
|
+
if (type === "image-product") {
|
|
6
|
+
const { product, version, cpe } = params;
|
|
7
|
+
return requestKey("nvd", type, { product, version, cpe }, scope);
|
|
8
|
+
}
|
|
9
|
+
return requestKey("nvd", type, type === "spip-advisories" ? {} : { id: cveId(params?.id) }, scope);
|
|
10
|
+
},
|
|
5
11
|
build(operation, params) {
|
|
12
|
+
if (operation === "image-product") {
|
|
13
|
+
const product = require("../../artifacts/product-catalog").upstreamProducts.get(params?.product);
|
|
14
|
+
const cpe = params?.cpe;
|
|
15
|
+
if (!cpe || !product || ![product.cpe, ...(product.cpeAliases || [])].includes(cpe)) throw Error("Unknown image product CPE");
|
|
16
|
+
if (typeof params.version !== "string" || !/^\d{1,8}(?:\.\d{1,8}){1,3}$/.test(params.version)) throw Error("Invalid image product version");
|
|
17
|
+
const query = new URLSearchParams({virtualMatchString: "cpe:2.3:a:" + cpe + ":" + params.version, resultsPerPage: "2000", startIndex: "0"});
|
|
18
|
+
return {url: "https://services.nvd.nist.gov/rest/json/cves/2.0?" + query};
|
|
19
|
+
}
|
|
6
20
|
if (operation === "spip-advisories") return {
|
|
7
21
|
url: "https://services.nvd.nist.gov/rest/json/cves/2.0?virtualMatchString=cpe:2.3:a:spip:spip&resultsPerPage=2000&startIndex=0",
|
|
8
22
|
};
|
|
9
23
|
// fkie-cad/nvd-json-data-feeds: a daily git mirror of the NVD API 2.0, one file per CVE
|
|
10
24
|
// holding the API's own `cve` object, bucketed by the id minus its last two digits
|
|
11
|
-
// (CVE-2021-44228 → CVE-2021-442xx). No key, no 5-per-30s rate limit. lib/nvd.js
|
|
25
|
+
// (CVE-2021-44228 → CVE-2021-442xx). No key, no 5-per-30s rate limit. lib/providers/nvd/enrich.js
|
|
12
26
|
// falls back to it when NVD itself does not answer.
|
|
13
27
|
if (operation === "cve-mirror") {
|
|
14
28
|
const id = cveId(params?.id);
|