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
|
@@ -6,15 +6,27 @@ const {Readable,Transform}=require('node:stream');
|
|
|
6
6
|
const {chain}=require('stream-chain');
|
|
7
7
|
const {parser}=require('stream-json');
|
|
8
8
|
const {streamObject}=require('stream-json/streamers/StreamObject');
|
|
9
|
-
const {createCacheRepository}=require('
|
|
10
|
-
const {getCacheDir}=require('
|
|
11
|
-
const compare=require('
|
|
9
|
+
const {createCacheRepository}=require('../../cache/repository');
|
|
10
|
+
const {getCacheDir}=require('../../cache/directory');
|
|
11
|
+
const compare=require('../../system-inventory/versions').debian;
|
|
12
12
|
const SOURCE='freexian-tracker', VERSION=1, URL='https://deb.freexian.com/extended-lts/tracker/data/json';
|
|
13
13
|
const packageName=p=>typeof p==='string' && /^[a-z0-9][a-z0-9+.-]{0,199}$/.test(p);
|
|
14
14
|
const plain=x=>!!x && typeof x==='object' && !Array.isArray(x);
|
|
15
15
|
function validatePackage(value){if(!plain(value)||!Object.keys(value).length)return false;return Object.entries(value).every(([id,record])=>/^(?:CVE-\d{4}-\d{4,}|TEMP-[A-Za-z0-9-]+)$/.test(id) && plain(record) && plain(record.releases));}
|
|
16
16
|
function validateTrackerSnapshot(body){return plain(body) && Object.keys(body).length>0 && Object.entries(body).every(([key,value])=>packageName(key)&&validatePackage(value));}
|
|
17
17
|
function projectTrackerSnapshot(body,params){if(!validateTrackerSnapshot(body)||!Array.isArray(params?.packages)||!params.packages.length||params.packages.length>1000||!params.packages.every(packageName))throw Error('invalid Freexian tracker snapshot');return {packages:Object.fromEntries(params.packages.filter(p=>Object.hasOwn(body,p)).map(p=>[p,body[p]]))};}
|
|
18
|
+
// Reduce package records to one release. A client assessing one Debian release reads nothing
|
|
19
|
+
// else, and the complete record of a kernel source package alone exceeds what a relay answers.
|
|
20
|
+
function forRelease(packages,release){
|
|
21
|
+
if(release===undefined)return packages;
|
|
22
|
+
const out={};
|
|
23
|
+
for(const [name,records] of Object.entries(packages)){
|
|
24
|
+
const kept={};
|
|
25
|
+
for(const [id,record] of Object.entries(records)){const info=record?.releases?.[release];if(plain(info))kept[id]={releases:{[release]:info}};}
|
|
26
|
+
if(Object.keys(kept).length)out[name]=kept;
|
|
27
|
+
}
|
|
28
|
+
return out;
|
|
29
|
+
}
|
|
18
30
|
async function readProjection(res,names,opts={}){
|
|
19
31
|
if(!res.ok){await res.body?.cancel();throw Error(`Freexian tracker HTTP ${res.status}`);}
|
|
20
32
|
const limit=opts.freexianTrackerMaxBytes??256*1024*1024;if(!Number.isSafeInteger(limit)||limit<1024||limit>1024*1024*1024)throw Error('invalid Freexian tracker byte limit');
|
|
@@ -51,22 +63,34 @@ async function assessFreexianTracker(inventory,opts={}){
|
|
|
51
63
|
const names=[...new Set(eligible.map(p=>p.sourceName))].sort();if(!names.length){result.coverage.push({source:SOURCE,execution:'not-applicable',result:'not-applicable'});return result;}const maxPackages=opts.freexianTrackerMaxPackages??100000;if(!Number.isSafeInteger(maxPackages)||maxPackages<1||names.length>maxPackages)throw Error('Freexian tracker package limit exceeded');
|
|
52
64
|
const repo=opts.cacheRepository||opts.repository||createCacheRepository(opts.cacheDir||getCacheDir()),ns=`freexian-tracker:v${VERSION}:${d.versionId.split('.')[0]}:${d.codename}`,now=Date.now(),ttl=opts.freexianTrackerTtlMs??4*3600*1000;
|
|
53
65
|
if(!Number.isSafeInteger(ttl)||ttl<1)throw Error('invalid Freexian tracker TTL');
|
|
54
|
-
let saved=repo.get(ns,'snapshot')?.value,failure=null;const origin=require('
|
|
66
|
+
let saved=repo.get(ns,'snapshot')?.value,failure=null;const origin=require('..').resourceOrigin();
|
|
67
|
+
// The release snapshot holds the packages of every inventory assessed so far: it grows, it
|
|
68
|
+
// is never narrowed to the last one. Each inventory also keeps its own projection, so that
|
|
69
|
+
// two prepared caches imported one after the other both replay offline.
|
|
70
|
+
const covers=snapshot=>!!snapshot && names.every(p=>snapshot.queriedPackages?.includes(p));
|
|
71
|
+
const inventoryKey='inventory:'+crypto.createHash('sha256').update(JSON.stringify(names)).digest('hex');
|
|
72
|
+
const wanted=[...new Set([...(saved?.origin===origin && Array.isArray(saved.queriedPackages) ? saved.queriedPackages.filter(packageName) : []),...names])].sort();
|
|
55
73
|
if(!opts.offline && (!saved||saved.origin!==origin||!Number.isFinite(saved.fetchedAt)||saved.fetchedAt<=0||saved.fetchedAt>now||now-saved.fetchedAt>=ttl||names.some(p=>!saved.queriedPackages?.includes(p))||opts.forceUpdate||opts.refresh)){
|
|
56
|
-
try{const signal=opts.signal?AbortSignal.any([opts.signal,AbortSignal.timeout(opts.timeoutMs??120000)]):AbortSignal.timeout(opts.timeoutMs??120000),proxy=require('
|
|
57
|
-
|
|
74
|
+
try{const signal=opts.signal?AbortSignal.any([opts.signal,AbortSignal.timeout(opts.timeoutMs??120000)]):AbortSignal.timeout(opts.timeoutMs??120000),proxy=require('..').hasProxyRoute(),chunks=proxy?Array.from({length:Math.ceil(wanted.length/1000)},(_,i)=>wanted.slice(i*1000,(i+1)*1000)):[wanted];let combined={},sourceHash=null,stamp=Date.now(),stale=false,staleReason=null;
|
|
75
|
+
// A relay is asked for this release only. One that predates the parameter refuses it (400):
|
|
76
|
+
// the request is then repeated in its former shape.
|
|
77
|
+
const ask=params=>opts.fetchResource?opts.fetchResource('tracker',params):require('..').getResource('freexian','tracker',params,{fetcher:opts.fetcher,streaming:true,noStore:true,signal});
|
|
78
|
+
for(const chunk of chunks){const packages=chunk.slice(0,1000);let res=await ask(proxy?{packages,release:d.codename}:{packages});if(proxy&&res.status===400){await res.body?.cancel();res=await ask({packages});}const data=await readProjection(res,chunk,{...opts,projected:proxy});Object.assign(combined,data.packages);if(chunks.length>1&&!data.sha256)throw Error('Freexian tracker projection lacks source hash across pages');if(sourceHash&&data.sha256&&sourceHash!==data.sha256)throw Error('Freexian tracker source changed during projection');sourceHash=sourceHash||data.sha256;const at=Date.parse(res.headers.get('x-fad-proxy-fetched-at')||''),valid=Number.isFinite(at)&&at>0&&at<=Date.now();if(proxy){if(valid)stamp=Math.min(stamp,at);else {stamp=null;stale=true;}stale ||= res.headers.get('x-fad-proxy')==='stale';const reason=res.headers.get('x-fad-proxy-reason');if(reason==='refresh-failed')staleReason='proxy refresh failed';}}
|
|
58
79
|
if(signal.aborted)throw signal.reason||Object.assign(Error('Freexian tracker request aborted'),{name:'AbortError'});
|
|
59
|
-
saved={packages:combined,sha256:sourceHash,queriedPackages:
|
|
80
|
+
saved={packages:combined,sha256:sourceHash,queriedPackages:wanted,fetchedAt:stamp,stale,staleReason,origin,sourceUrl:URL};repo.put(ns,'snapshot',saved,{fetchedAt:saved.fetchedAt||0,stale:saved.stale});
|
|
81
|
+
repo.put(ns,inventoryKey,{...saved,queriedPackages:names,packages:Object.fromEntries(names.filter(p=>Object.hasOwn(combined,p)).map(p=>[p,combined[p]]))},{fetchedAt:saved.fetchedAt||0,stale:saved.stale});repo.delete(ns,'failure');}catch(error){if(opts.signal?.aborted)throw error;failure=error;repo.put(ns,'failure',{origin,reason:error.message,attemptedAt:Date.now()});if(saved?.origin===origin){saved={...saved,stale:true,staleReason:`refresh failed: ${error.message}`};repo.put(ns,'snapshot',saved,{fetchedAt:saved.fetchedAt||0,stale:true});}else saved=null;result.warnings.push({type:'source-unavailable',source:SOURCE,message:`Freexian tracker: ${error.message}`});}
|
|
60
82
|
}
|
|
61
83
|
if(opts.offline){const cachedFailure=repo.get(ns,'failure')?.value;if(cachedFailure && (!saved || cachedFailure.origin===saved.origin)){failure=Error(cachedFailure.reason);result.warnings.push({type:'source-unavailable',source:SOURCE,message:`Freexian tracker: ${cachedFailure.reason}`});}}
|
|
84
|
+
if(!covers(saved)){const own=repo.get(ns,inventoryKey)?.value;if(covers(own) && (opts.offline || own.origin===origin))saved=failure?{...own,stale:true,staleReason:`refresh failed: ${failure.message}`}:own;}
|
|
62
85
|
if(!saved){result.coverage.push({source:SOURCE,execution:failure?'failed':'not-run',result:'indeterminate',reason:failure?.message||'No Freexian tracker snapshot cached.'});return result;}
|
|
63
86
|
if(saved.staleReason&&!failure)result.warnings.push({type:'source-unavailable',source:SOURCE,message:`Freexian tracker: ${saved.staleReason}; saved data retained.`});
|
|
64
87
|
let missing=0;
|
|
65
|
-
for(const dep of eligible){if(!saved.queriedPackages?.includes(dep.sourceName)){missing++;continue;}for(const [id,record] of Object.entries(saved.packages[dep.sourceName]||{})){if(!/^CVE-\d{4}-\d{4,}$/.test(id))continue;const release=releaseInfo(record,d.codename);if(!release)continue;const status=evaluate(release,dep.sourceVersion),evidence={distribution:d,sourceName:dep.sourceName,sourceVersion:dep.sourceVersion,releaseStatus:release.status,fixedVersion:release.fixed_version??null,sourceURL:`https://deb.freexian.com/extended-lts/tracker/${id}`,sha256:saved.sha256,fetchedAt:saved.fetchedAt,urgency:release.urgency??null,nodsa:release.nodsa??null,nodsaReason:release.nodsa_reason??null,repositories:release.repositories||{},signatureVerified:false};result.assessments.push({dep,cveId:id,source:SOURCE,status,evidence});if(status==='unknown' && !(release.status==='resolved' && release.fixed_version==='0'))result.observations.push({dep,cveId:id,source:SOURCE,status:'possible',sourceUrl:evidence.sourceURL,reason:'The tracker release status applies to a different archive source version; applicability to the installed version is undetermined.',evidence});if(status==='affected'){const cve={id,summary:record.description||'',severity:'UNKNOWN',fixVersion:release.fixed_version&&release.fixed_version!=='0'?release.fixed_version:null,historicalEvidence:evidence};result.matches.push({dep,source:SOURCE,cve});}}}
|
|
88
|
+
for(const dep of eligible){if(!saved.queriedPackages?.includes(dep.sourceName)){missing++;continue;}for(const [id,record] of Object.entries(saved.packages[dep.sourceName]||{})){if(!/^CVE-\d{4}-\d{4,}$/.test(id))continue;const release=releaseInfo(record,d.codename);if(!release)continue;const status=evaluate(release,dep.sourceVersion),evidence={distribution:d,sourceName:dep.sourceName,sourceVersion:dep.sourceVersion,releaseStatus:release.status,fixedVersion:release.fixed_version??null,sourceURL:`https://deb.freexian.com/extended-lts/tracker/${id}`,sha256:saved.sha256,fetchedAt:saved.fetchedAt,urgency:release.urgency??null,nodsa:release.nodsa??null,nodsaReason:release.nodsa_reason??null,repositories:release.repositories||{},signatureVerified:false};result.assessments.push({dep,cveId:id,source:SOURCE,status,evidence});if(status==='unknown' && !(release.status==='resolved' && release.fixed_version==='0'))result.observations.push({dep,cveId:id,source:SOURCE,status:'possible',sourceUrl:evidence.sourceURL,reason:'The tracker release status applies to a different archive source version; applicability to the installed version is undetermined.',evidence});if(status==='affected'){const cve={id,summary:record.description||'',severity:'UNKNOWN',fixVersion:release.fixed_version&&release.fixed_version!=='0'?release.fixed_version:null,historicalEvidence:evidence,...(release.urgency ? {distributionUrgency:{source:'Freexian',release:d.codename,value:release.urgency}} : {})};result.matches.push({dep,source:SOURCE,cve});}}}
|
|
66
89
|
// A not-affected archive entry is not positive evidence against an older
|
|
67
90
|
// installed package. Keep its unknown assessment for independent refinement,
|
|
68
91
|
// without manufacturing a suspected vulnerability from the missing proof.
|
|
69
92
|
const assessmentCounts=result.assessments.reduce((counts,a)=>{counts[a.status]=(counts[a.status]||0)+1;return counts;},{});
|
|
93
|
+
if(!failure && !saved.stale && !missing)for(const pkg of eligible)opts.onPackageConsulted?.(pkg,SOURCE);
|
|
70
94
|
result.coverage.push({source:SOURCE,execution:failure||saved.stale||missing?'partial':'completed',result:'consulted',assessmentCounts,fetchedAt:saved.fetchedAt,sha256:saved.sha256,queriedPackages:saved.queriedPackages.length,...(missing?{missingPackages:missing}:{}),...(failure?{reason:failure.message}:{})});return result;
|
|
71
95
|
}
|
|
72
|
-
module.exports={SOURCE,validateTrackerSnapshot,projectTrackerSnapshot,parseTrackerBytes,assessFreexianTracker};
|
|
96
|
+
module.exports={SOURCE,validateTrackerSnapshot,projectTrackerSnapshot,parseTrackerBytes,forRelease,assessFreexianTracker};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Signed GCVE directory + bounded, explicit GNA origin allowlist. A verified
|
|
3
3
|
// directory establishes entry provenance, not trust in each GNA's assertions.
|
|
4
4
|
const crypto = require('node:crypto');
|
|
5
|
-
const { buildGcveIndex, readGcveIndex, writeGcveIndex } = require('./
|
|
5
|
+
const { buildGcveIndex, readGcveIndex, writeGcveIndex } = require('./local-index');
|
|
6
6
|
const DIRECTORY = 'https://gcve.eu/dist/gcve.json';
|
|
7
7
|
const SIGNATURE = 'https://gcve.eu/dist/gcve.json.sigsha512';
|
|
8
8
|
const TRUSTED_KEY = `-----BEGIN PUBLIC KEY-----
|
|
@@ -76,7 +76,7 @@ async function collectGcveIndex({fetcher=globalThis.fetch, allowedOrigins=DEFAUL
|
|
|
76
76
|
return {index,diagnostics};
|
|
77
77
|
}
|
|
78
78
|
function proxyGcveFetcher(url,{signal}={}){
|
|
79
|
-
const {getResource}=require('
|
|
79
|
+
const {getResource}=require('..');
|
|
80
80
|
let type,params={};
|
|
81
81
|
if(url===DIRECTORY)type='directory';
|
|
82
82
|
else if(url===SIGNATURE)type='signature';
|
|
@@ -94,8 +94,8 @@ async function updateGcveIndex({cacheFile, offline=false, fetcher=globalThis.fet
|
|
|
94
94
|
const {index,diagnostics} = await collectGcveIndex({fetcher,allowedOrigins,trustedKey});
|
|
95
95
|
const path = require('node:path');
|
|
96
96
|
const parent = path.dirname(cacheFile);
|
|
97
|
-
const store = require('
|
|
98
|
-
try { await require('
|
|
97
|
+
const store = require('../../advisories/store').openAdvisoryStore({cacheDir:path.basename(parent) === 'gcve-data' ? path.dirname(parent) : parent});
|
|
98
|
+
try { await require('../../advisories/native').importGcveIndex(store,index); }
|
|
99
99
|
finally { store.close(); }
|
|
100
100
|
writeGcveIndex(cacheFile,index);
|
|
101
101
|
return {index,diagnostics,offline:false};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* lib/gcve.js — the GCVE identifier of a CVE.
|
|
2
|
+
* lib/providers/gcve/id.js — the GCVE identifier of a CVE.
|
|
3
3
|
*
|
|
4
4
|
* GCVE (Global CVE allocation system, run by CIRCL, Luxembourg) lets independent
|
|
5
5
|
* numbering authorities (GNAs) allocate vulnerability ids without MITRE. Every CVE id
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
// Records and typed relationships are retained; only explicit package coordinates
|
|
4
4
|
// are indexed. Unrecognised formats/versions remain unknown, never "not affected".
|
|
5
5
|
const path = require('node:path');
|
|
6
|
-
const { compareMavenVersions } = require('
|
|
7
|
-
const { osvEcosystemFor, osvPkgName } = require('
|
|
6
|
+
const { compareMavenVersions } = require('../../codecs/maven/version');
|
|
7
|
+
const { osvEcosystemFor, osvPkgName } = require('../osv/query');
|
|
8
8
|
const FORMAT = 'vigievuln-gcve-index/1';
|
|
9
9
|
const MAX_RECORD = 16 * 1024 * 1024;
|
|
10
10
|
const validId = id => typeof id === 'string' && id.length <= 255 && /^GCVE-[0-9]+-[\x22-\x7e]+$/i.test(id);
|
|
@@ -168,14 +168,14 @@ function matchGcveDeps(deps, index) {
|
|
|
168
168
|
|
|
169
169
|
function readGcveIndex(file) {
|
|
170
170
|
const parent=path.dirname(file),cacheDir=path.basename(parent)==='gcve-data'?path.dirname(parent):parent;
|
|
171
|
-
const value=require('
|
|
171
|
+
const value=require('../../cache/repository').createCacheRepository(cacheDir).get('catalogue','gcve')?.value;
|
|
172
172
|
if (value?.format !== FORMAT || !Array.isArray(value.coverage) || !value.byPackage || typeof value.byPackage !== 'object') throw Error('invalid GCVE index');
|
|
173
173
|
return value;
|
|
174
174
|
}
|
|
175
175
|
function writeGcveIndex(file, index) {
|
|
176
176
|
if (index?.format !== FORMAT) throw Error('invalid GCVE index');
|
|
177
177
|
const parent=path.dirname(file),cacheDir=path.basename(parent)==='gcve-data'?path.dirname(parent):parent;
|
|
178
|
-
require('
|
|
178
|
+
require('../../cache/repository').createCacheRepository(cacheDir).put('catalogue','gcve',index);
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
module.exports = { FORMAT, validId, identity, explicitPackage, buildGcveIndex, affectedVersion, matchGcveDeps, readGcveIndex, writeGcveIndex };
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* coordinate, and that inference is documented per lane.
|
|
10
10
|
*/
|
|
11
11
|
const crypto = require("node:crypto");
|
|
12
|
-
const { satisfiesComposerConstraint, cmpComposerVersions } = require("../packagist
|
|
12
|
+
const { satisfiesComposerConstraint, cmpComposerVersions } = require("../packagist/audit");
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Publisher range grammars observed in the live feeds (2026-09-23), applied BEFORE the
|
|
@@ -204,7 +204,11 @@ function assessGithubAdvisories(input, components = [], { sourceId = "github-adv
|
|
|
204
204
|
cvssVector: advisory.cvss?.vector_string || null,
|
|
205
205
|
cvssVersion: advisory.cvss?.vector_string?.split("/")[0] || null,
|
|
206
206
|
description: advisory.summary || "", title: advisory.summary || null,
|
|
207
|
-
published: advisory.published_at || null, modified: advisory.updated_at || null,
|
|
207
|
+
published: advisory.published_at || null, modified: advisory.updated_at || null,
|
|
208
|
+
cwes: [...new Set([
|
|
209
|
+
...(Array.isArray(advisory.cwe_ids) ? advisory.cwe_ids : []),
|
|
210
|
+
...(Array.isArray(advisory.cwes) ? advisory.cwes.map(c => c?.cwe_id) : []),
|
|
211
|
+
].filter(id => typeof id === "string" && /^CWE-[1-9]\d*$/i.test(id)).map(id => id.toUpperCase()))],
|
|
208
212
|
fixVersion: nextPatchedVersion(component.version, vulnerability.patched_versions),
|
|
209
213
|
osvRefs: /^https?:\/\//i.test(advisory.html_url || "") ? [{ url: advisory.html_url, type: "ADVISORY" }] : [] } });
|
|
210
214
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const { encodePath } = require("
|
|
1
|
+
const { encodePath } = require("../common");
|
|
2
2
|
module.exports = {
|
|
3
3
|
id: "github", ttlMs: 24 * 3600 * 1000,
|
|
4
4
|
build(type, params) {
|
|
@@ -8,6 +8,8 @@ module.exports = {
|
|
|
8
8
|
throw new Error("invalid GitHub advisory page");
|
|
9
9
|
return { url: `https://api.github.com/repos/${encodePath(params.repo)}/security-advisories?per_page=${perPage}${page > 1 ? `&page=${page}` : ""}` };
|
|
10
10
|
}
|
|
11
|
+
if (type === "theme-release" && ["TryGhost/Casper","TryGhost/Source"].includes(params?.repo))
|
|
12
|
+
return { url: "https://api.github.com/repos/" + params.repo + "/releases/latest" };
|
|
11
13
|
if (type === "cve-maven") return { url: "https://api.github.com/repos/CVEProject/cvelistV5" };
|
|
12
14
|
if (type === "cve-npm") return { url: "https://api.github.com/repos/CVEProject/cvelistV5", proxyOnly: true };
|
|
13
15
|
if (type === "cve-packages") return { url: "https://api.github.com/repos/CVEProject/cvelistV5", proxyOnly: true };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
// Normalize public repository advisories; never infer a Maven identity from a
|
|
3
3
|
// repository, product name or code path. Ranges are source claims, not fixes.
|
|
4
|
-
const {compareMavenVersions}=require('
|
|
4
|
+
const {compareMavenVersions}=require('../../codecs/maven/version');
|
|
5
5
|
const VERSION='[0-9][0-9A-Za-z._+-]*';
|
|
6
6
|
const validVersion=v=>typeof v==='string'&&new RegExp(`^${VERSION}$`).test(v)&&v.length<=128&&!/\.\.|\+\+|--|__|\d{16}/.test(v);
|
|
7
7
|
const unknown=()=>({type:'UNKNOWN',events:[]});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* lib/
|
|
2
|
+
* lib/providers/hashid/identify.js — identity-by-checksum for unmanaged artifacts.
|
|
3
3
|
*
|
|
4
4
|
* Two known-good sources, tried in order:
|
|
5
5
|
* 1. deps.dev query-by-hash → exact package coordinate (whole published archive).
|
|
@@ -15,7 +15,7 @@ const fs = require("fs");
|
|
|
15
15
|
const path = require("path");
|
|
16
16
|
const os = require("os");
|
|
17
17
|
|
|
18
|
-
const CACHE_DIR = path.join(require("
|
|
18
|
+
const CACHE_DIR = path.join(require("../../cache/directory").getCacheDir());
|
|
19
19
|
const CACHE_PATH = path.join(CACHE_DIR, "hash-id-cache.json");
|
|
20
20
|
const CACHE_TTL_MS = 4 * 3600 * 1000;
|
|
21
21
|
const DEPSDEV = "https://api.deps.dev/v3/query";
|
|
@@ -46,12 +46,12 @@ function parseCircl(body) {
|
|
|
46
46
|
|
|
47
47
|
function loadCache({ offline = false } = {}) {
|
|
48
48
|
try {
|
|
49
|
-
const d = require('
|
|
50
|
-
if (offline || require('
|
|
49
|
+
const d = require('../../cache/json').load(CACHE_DIR,'hash-id',null);
|
|
50
|
+
if (offline || require('../../cache/policy').fresh(d._fetchedAt || 0, CACHE_TTL_MS)) return d.entries || {};
|
|
51
51
|
} catch { /* ignore */ }
|
|
52
52
|
return {};
|
|
53
53
|
}
|
|
54
|
-
function saveCache(entries) { require('
|
|
54
|
+
function saveCache(entries) { require('../../cache/json').save(CACHE_DIR,'hash-id',{ _fetchedAt: Date.now(), entries }); }
|
|
55
55
|
|
|
56
56
|
async function lookupHash(hashes, opts = {}) {
|
|
57
57
|
const { fetcher = globalThis.fetch, offline = false, cache } = opts;
|
|
@@ -65,7 +65,7 @@ async function lookupHash(hashes, opts = {}) {
|
|
|
65
65
|
// 1) deps.dev (SHA1 base64)
|
|
66
66
|
if (hashes.sha1) {
|
|
67
67
|
try {
|
|
68
|
-
const r = await require("
|
|
68
|
+
const r = await require("..").getResource("hashid", "depsdev-sha1",
|
|
69
69
|
{ base64: sha1ToBase64(hashes.sha1) }, { fetcher, headers: { "User-Agent": "vigievuln-hashid" } });
|
|
70
70
|
if (r.ok) identity = parseDepsDev(await r.json());
|
|
71
71
|
} catch { /* ignore, try CIRCL */ }
|
|
@@ -73,7 +73,7 @@ async function lookupHash(hashes, opts = {}) {
|
|
|
73
73
|
// 2) CIRCL (SHA-256)
|
|
74
74
|
if (!identity && hashes.sha256) {
|
|
75
75
|
try {
|
|
76
|
-
const r = await require("
|
|
76
|
+
const r = await require("..").getResource("hashid", "circl-sha256", { sha256: hashes.sha256 },
|
|
77
77
|
{ fetcher, headers: { "User-Agent": "vigievuln-hashid", Accept: "application/json" } });
|
|
78
78
|
if (r.ok) identity = parseCircl(await r.json());
|
|
79
79
|
} catch { /* ignore */ }
|
package/lib/providers/index.js
CHANGED
|
@@ -9,18 +9,18 @@ const providers = [
|
|
|
9
9
|
require("./nvd"), require("./osv"), require("./packagist"), require("./epss"),
|
|
10
10
|
require("./kev"), require("./eol"), require("./npm"), require("./pypi"),
|
|
11
11
|
require("./ruby"), require("./go"), require("./nuget"),
|
|
12
|
-
require("./wordfence"), require("./wordpress"), require("./github"), require("./drupal"),
|
|
12
|
+
require("./wordfence"), require("./wordpress"), require("./wpvulnerability"), require("./github"), require("./drupal"),
|
|
13
13
|
require("./maven"), require("./hashid"), require("./osvdb"), require("./retire"),
|
|
14
|
-
require("./euvd"), require("./certfr"), require("./gcve"), require("./vigievuln"), require("./alpine"), require("./debian"), require("./nginx"), require("./freexian"),
|
|
14
|
+
require("./euvd"), require("./certfr"), require("./gcve"), require("./vigievuln"), require("./alpine"), require("./debian"), require("./rubysec"), require("./redhat"), require("./wolfi"), require("./nginx"), require("./package-releases"), require("./freexian"), require("./mit-kerberos"),
|
|
15
15
|
];
|
|
16
16
|
const byId = new Map(providers.map(provider => [provider.id, provider]));
|
|
17
17
|
let route = { hosted: false, proxyUrl: null, token: null, store: null, hostedStore: null, health: null, fetcher: null, maxBodyBytes: 32 * 1024 * 1024 };
|
|
18
18
|
const inFlight = new Map();
|
|
19
|
-
let proxyThrottle = require('
|
|
19
|
+
let proxyThrottle = require('./proxy-throttle').createProxyThrottle();
|
|
20
20
|
const copyResponse = response => typeof response?.clone === "function" ? response.clone() : response;
|
|
21
21
|
|
|
22
22
|
function configureResourceRoute(options = {}) {
|
|
23
|
-
if (options.resetRateLimit) proxyThrottle = require('
|
|
23
|
+
if (options.resetRateLimit) proxyThrottle = require('./proxy-throttle').createProxyThrottle();
|
|
24
24
|
if (options.proxyUrl != null && !/^https?:\/\//i.test(String(options.proxyUrl)))
|
|
25
25
|
throw new Error("proxy-cache URL must be http(s)");
|
|
26
26
|
route = { ...route, ...options, proxyUrl: options.proxyUrl ? String(options.proxyUrl).replace(/\/+$/, "") : null };
|
|
@@ -54,7 +54,7 @@ function persist(store, key, response, body, ttlMs) {
|
|
|
54
54
|
async function getResource(id, type, params, options = {}) {
|
|
55
55
|
const provider = getProvider(id);
|
|
56
56
|
const failureKey = require('./common').failureKey(id, type, params);
|
|
57
|
-
const revalidate = !options.offline && !!(options.forceRefresh || require('../cache
|
|
57
|
+
const revalidate = !options.offline && !!(options.forceRefresh || require('../cache/policy').shouldForceUpdate()) && provider.revalidateTypes?.includes(type);
|
|
58
58
|
const request = provider.build(type, params);
|
|
59
59
|
if (request.proxyOnly && (!route.proxyUrl || options.direct || options.urlOverride))
|
|
60
60
|
throw new Error(`${id}.${type} requires a proxy; direct bulk fallback is unavailable`);
|
|
@@ -68,7 +68,7 @@ async function getResource(id, type, params, options = {}) {
|
|
|
68
68
|
const store = options.urlOverride || options.streaming ? null : (hasHostedProxy() && !options.offline ? route.hostedStore : (options.store || route.store));
|
|
69
69
|
let entry = store?.get(key) || null;
|
|
70
70
|
if (entry && id === "github" && type === "publisher-advisories" && !entry.responseHeaders) entry = null;
|
|
71
|
-
const policy=require('../cache
|
|
71
|
+
const policy=require('../cache/policy');
|
|
72
72
|
const cachedFresh = entry && (options.offline
|
|
73
73
|
? Date.now() >= entry.fetchedAt && Date.now()-entry.fetchedAt < Math.min(entry.ttlMs,policy.DEFAULT_TTL_MS)
|
|
74
74
|
: policy.fresh(entry.fetchedAt,entry.ttlMs));
|
|
@@ -93,10 +93,10 @@ async function getResource(id, type, params, options = {}) {
|
|
|
93
93
|
const sendProxy = () => fetcher(`${route.proxyUrl}/v1/resource`, { method: "POST", headers: proxyHeaders,
|
|
94
94
|
redirect: "error", // Never forward a proxy credential to a redirected origin.
|
|
95
95
|
body: JSON.stringify({ provider: id, type, params, headers: Object.fromEntries(headers.entries()), ...(revalidate ? {revalidate:true} : {}) }),
|
|
96
|
-
...((options.signal || route.hosted) ? { signal: options.signal || AbortSignal.timeout(options.requestTimeoutMs || 15000) } : {}) });
|
|
96
|
+
...((options.signal || route.hosted || options.requestTimeoutMs) ? { signal: options.signal || AbortSignal.timeout(options.requestTimeoutMs || 15000) } : {}) });
|
|
97
97
|
const callProxy = () => (route.proxyThrottle || proxyThrottle).request(sendProxy, options.signal, {label: `${id}.${type}`, retryDenied: options.retryProxyDenied !== false, retryTransient: route.hosted && !options.noSourceRetry, ...(route.proxyRateLimitMaxWaitMs != null ? {waitBudgetMs:route.proxyRateLimitMaxWaitMs} : {}), ...(route.proxyRateLimitMaxRetries != null ? {rateRetries:route.proxyRateLimitMaxRetries} : {})});
|
|
98
98
|
response = route.health && !entry && !route.hosted && !options.noSourceRetry
|
|
99
|
-
? await require("../source-health").guardedFetch({ health: route.health, requestKey: failureKey, handledRateLimit:true,
|
|
99
|
+
? await require("../scan/source-health").guardedFetch({ health: route.health, requestKey: failureKey, handledRateLimit:true, onRetry:route.onRetry,
|
|
100
100
|
fetch: callProxy, ...(route.sleep ? { sleep: route.sleep } : {}) })(request.url,
|
|
101
101
|
options.signal ? { signal: options.signal } : undefined)
|
|
102
102
|
: await callProxy();
|
|
@@ -106,8 +106,13 @@ async function getResource(id, type, params, options = {}) {
|
|
|
106
106
|
if(entry.responseHeaders?.etag){directHeaders['if-none-match']=entry.responseHeaders.etag;conditional=true;}
|
|
107
107
|
else if(entry.responseHeaders?.['last-modified']){directHeaders['if-modified-since']=entry.responseHeaders['last-modified'];conditional=true;}
|
|
108
108
|
}
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
const privatePom = id === 'maven' && options.urlOverride && options.requestTimeoutMs && !require('../scan/source-health').sourceForUrl(target);
|
|
110
|
+
const host = privatePom && new URL(target).host;
|
|
111
|
+
response = await fetcher(target, { ...request.init, headers: directHeaders,
|
|
112
|
+
...(privatePom ? {[require('../scan/source-health').REQUEST_SOURCE]:{id:`maven:${host}`,label:`Maven POM (${host})`,flag:'check repository availability'}} : {}), [require('../scan/source-health').REQUEST_KEY]: failureKey,
|
|
113
|
+
...(options.signal ? { signal: options.signal } : options.requestTimeoutMs ? {
|
|
114
|
+
signal: AbortSignal.timeout(options.requestTimeoutMs), [require('../scan/source-health').ATTEMPT_TIMEOUT]: options.requestTimeoutMs,
|
|
115
|
+
} : {}) });
|
|
111
116
|
}
|
|
112
117
|
if(response.status===304 && conditional) {
|
|
113
118
|
const stamp=Date.now(),ttlMs=Math.min(provider.ttlMs||policy.DEFAULT_TTL_MS,policy.DEFAULT_TTL_MS);
|
|
@@ -119,8 +124,8 @@ async function getResource(id, type, params, options = {}) {
|
|
|
119
124
|
if (response.headers?.get?.("x-fad-proxy") === "stale")
|
|
120
125
|
route.health?.markStale?.(id, response.headers.get("x-fad-proxy-fetched-at"),{reason:response.headers.get('x-fad-proxy-reason'),requestKey:failureKey,refreshStatus:response.headers.get('x-fad-proxy-refresh-status'),refreshCause:response.headers.get('x-fad-proxy-refresh-cause'),retryAfter:response.headers.get('retry-after')});
|
|
121
126
|
if (hasHostedProxy() && route.health && !options.noSourceRetry && (response.status === 403 || response.status === 429 || response.status >= 500)) {
|
|
122
|
-
const source = require('../source-health').sourceForUrl(request.url);
|
|
123
|
-
if (source) route.health.markOutage(source.id, {url: request.url, code: require('
|
|
127
|
+
const source = require('../scan/source-health').sourceForUrl(request.url);
|
|
128
|
+
if (source) route.health.markOutage(source.id, {url: request.url, code: require('./request-failure').responseFailure(response,{viaProxy:true}).reason, requestKey: failureKey});
|
|
124
129
|
}
|
|
125
130
|
if (entry && (response.status === 403 || response.status === 429 || response.status >= 500)) {
|
|
126
131
|
route.health?.markStale?.(id, new Date(entry.fetchedAt).toISOString(),{reason:'refresh-failed',requestKey:failureKey});
|
|
@@ -138,7 +143,7 @@ async function getResource(id, type, params, options = {}) {
|
|
|
138
143
|
} catch (error) {
|
|
139
144
|
if (entry) { route.health?.markStale?.(id, new Date(entry.fetchedAt).toISOString(),{reason:'refresh-failed',requestKey:failureKey}); return cachedResponse(entry, "stale",store,true); }
|
|
140
145
|
if (route.health && !options.noSourceRetry && !options.urlOverride) {
|
|
141
|
-
const { sourceForUrl } = require("../source-health");
|
|
146
|
+
const { sourceForUrl } = require("../scan/source-health");
|
|
142
147
|
const source = sourceForUrl(request.url);
|
|
143
148
|
if (source) route.health.markOutage(source.id, { url: request.url, code: error.code || error.message, requestKey: failureKey });
|
|
144
149
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* lib/kev.js — enrich matches with CISA KEV (Known Exploited Vulnerabilities).
|
|
2
|
+
* lib/providers/kev/enrich.js — enrich matches with CISA KEV (Known Exploited Vulnerabilities).
|
|
3
3
|
*
|
|
4
4
|
* KEV is a single authoritative catalogue of CVEs CISA has observed being
|
|
5
5
|
* exploited in the wild. Membership is the strongest "patch this now" signal.
|
|
@@ -14,22 +14,22 @@ const fs = require("fs");
|
|
|
14
14
|
const path = require("path");
|
|
15
15
|
const os = require("os");
|
|
16
16
|
|
|
17
|
-
const CACHE_DIR = path.join(require("
|
|
17
|
+
const CACHE_DIR = path.join(require("../../cache/directory").getCacheDir());
|
|
18
18
|
const CACHE_PATH = path.join(CACHE_DIR, "kev-cache.json");
|
|
19
19
|
const CACHE_TTL_MS = 4 * 3600 * 1000;
|
|
20
20
|
const KEV_URL = "https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json";
|
|
21
21
|
|
|
22
22
|
function readCache({ offline = false, cacheDir = CACHE_DIR } = {}) {
|
|
23
23
|
try {
|
|
24
|
-
const data = require('
|
|
25
|
-
if (offline || require('
|
|
24
|
+
const data = require('../../cache/repository').createCacheRepository(cacheDir).get('catalogue','kev')?.value;
|
|
25
|
+
if (offline || require('../../cache/policy').fresh(data._fetchedAt, CACHE_TTL_MS)) return data.body;
|
|
26
26
|
} catch { /* ignore */ }
|
|
27
27
|
return null;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
function writeCache(body, fetchedAt = Date.now(), cacheDir = CACHE_DIR) {
|
|
31
31
|
try {
|
|
32
|
-
require('
|
|
32
|
+
require('../../cache/repository').createCacheRepository(cacheDir).put('catalogue','kev',{ _fetchedAt: fetchedAt, body });
|
|
33
33
|
} catch { /* ignore */ }
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -60,7 +60,7 @@ async function enrichKev(matches, opts = {}) {
|
|
|
60
60
|
const ids = [...new Set(matches.map(m => m.cve?.id).filter(id => /^CVE-\d{4}-\d{4,7}$/.test(id || "")))];
|
|
61
61
|
const byId = new Map();
|
|
62
62
|
for (let i = 0; i < ids.length; i += 100) {
|
|
63
|
-
const r = await require("
|
|
63
|
+
const r = await require("..").getResource("kev", "cves", { ids: ids.slice(i, i + 100) }, { fetcher, noStore: true, streaming: true });
|
|
64
64
|
if (!r.ok) throw new Error(`hosted KEV unavailable (HTTP ${r.status})`);
|
|
65
65
|
const data = await r.json();
|
|
66
66
|
if (!Array.isArray(data.items)) throw new Error("invalid hosted KEV response");
|
|
@@ -76,11 +76,14 @@ async function enrichKev(matches, opts = {}) {
|
|
|
76
76
|
let index = readCache({ offline, cacheDir: opts.cacheDir });
|
|
77
77
|
if (!index && !offline) {
|
|
78
78
|
try {
|
|
79
|
-
const r = await require("
|
|
79
|
+
const r = await require("..").getResource("kev", "catalog", {},
|
|
80
80
|
{ fetcher, headers: { "User-Agent": "vigievuln-kev" } });
|
|
81
81
|
if (r.ok) {
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
const catalog = await r.json();
|
|
83
|
+
if (!Array.isArray(catalog?.vulnerabilities) || (catalog.count != null && catalog.count !== catalog.vulnerabilities.length) ||
|
|
84
|
+
catalog.vulnerabilities.some(row => !/^CVE-\d{4}-\d{4,}$/i.test(row?.cveID || ''))) throw Error('invalid CISA KEV catalogue');
|
|
85
|
+
index = indexKevCatalog(catalog);
|
|
86
|
+
writeCache(index, require('../common').responseFetchedAt(r), opts.cacheDir);
|
|
84
87
|
} else if (verbose) {
|
|
85
88
|
console.warn(` KEV HTTP ${r.status}`);
|
|
86
89
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const path = require('node:path');
|
|
4
|
-
const {createCacheRepository} = require('
|
|
4
|
+
const {createCacheRepository} = require('../../cache/repository');
|
|
5
5
|
|
|
6
6
|
function slot(file) {
|
|
7
7
|
const dir=path.dirname(file);
|
|
@@ -13,9 +13,9 @@ function read(file) {
|
|
|
13
13
|
try { return createCacheRepository(cacheDir).get(namespace,key); }
|
|
14
14
|
catch { return null; }
|
|
15
15
|
}
|
|
16
|
-
function write(file,value) {
|
|
16
|
+
function write(file,value,metadata={}) {
|
|
17
17
|
const {cacheDir,key,namespace}=slot(file);
|
|
18
|
-
try { createCacheRepository(cacheDir).put(namespace,key,value); }
|
|
18
|
+
try { createCacheRepository(cacheDir).put(namespace,key,value,{metadata}); }
|
|
19
19
|
catch { /* Optional cache. */ }
|
|
20
20
|
}
|
|
21
21
|
module.exports={read,write};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
const { encodePath } = require("
|
|
1
|
+
const { encodePath } = require("../common");
|
|
2
2
|
module.exports = {
|
|
3
3
|
id: "maven", ttlMs: 24 * 3600 * 1000,
|
|
4
4
|
build(type, params) {
|
|
5
|
-
if (
|
|
5
|
+
if (params?.repository !== undefined && params.repository !== 'google') throw new Error('invalid Maven repository');
|
|
6
|
+
const base=params?.repository==='google' ? 'https://dl.google.com/dl/android/maven2/' : 'https://repo1.maven.org/maven2/';
|
|
7
|
+
if (type === "preflight") return { url: base, init: { method: "HEAD" } };
|
|
6
8
|
if (type === "artifact" && typeof params?.path === "string" && params.path && !params.path.split("/").some(s => s === "." || s === ".."))
|
|
7
|
-
return { url:
|
|
9
|
+
return { url: `${base}${encodePath(params.path.replace(/^\/+/, ""))}`,
|
|
8
10
|
init: { method: params.method === "HEAD" ? "HEAD" : "GET" } };
|
|
9
11
|
if (type === "latest" && params?.group && params?.artifact)
|
|
10
12
|
return { url: `https://search.maven.org/solrsearch/select?q=g:%22${encodeURIComponent(params.group)}%22+AND+a:%22${encodeURIComponent(params.artifact)}%22&core=gav&rows=1&wt=json` };
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* file metadata (which can come from a different side of that merge).
|
|
6
6
|
*/
|
|
7
7
|
const crypto = require("node:crypto");
|
|
8
|
-
const core = require("
|
|
9
|
-
const { existsInAny } = require("./
|
|
10
|
-
const { isAbsentStatus } = require("
|
|
8
|
+
const core = require("../../codecs/maven/pom");
|
|
9
|
+
const { existsInAny } = require("./repo");
|
|
10
|
+
const { isAbsentStatus } = require("../../inventory/private-deps");
|
|
11
11
|
|
|
12
12
|
const MAX_AGE_MS = 4 * 3600 * 1000;
|
|
13
13
|
const ABSENCE_EVIDENCE = "all-repositories-404-or-410/1";
|
|
@@ -50,7 +50,7 @@ async function checkMavenLibExist(groupId, artifactId, repos, cache, opts = {})
|
|
|
50
50
|
const entry = cache?.entries?.[key];
|
|
51
51
|
if (entry === true) return true;
|
|
52
52
|
if (confirmedAbsence(entry) && entry.repositories === repositories
|
|
53
|
-
&& (opts.offline || require('
|
|
53
|
+
&& (opts.offline || require('../../cache/policy').fresh(entry.checkedAt, MAX_AGE_MS, now))) return false;
|
|
54
54
|
if (cache?.entries) delete cache.entries[key];
|
|
55
55
|
if (opts.offline) return null;
|
|
56
56
|
|
|
@@ -82,4 +82,4 @@ async function checkMavenLibExist(groupId, artifactId, repos, cache, opts = {})
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
module.exports = { MAX_AGE_MS, discardUnverifiedEntries, checkMavenLibExist };
|
|
85
|
+
module.exports = { MAX_AGE_MS, discardUnverifiedEntries, checkMavenLibExist, repositoryKey };
|