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
|
@@ -18,6 +18,7 @@ const { sniffKind, extKind } = require("./sniff");
|
|
|
18
18
|
const SKIP = new Set([
|
|
19
19
|
".git", ".idea", ".vscode", "node_modules", "dist", "build", "out",
|
|
20
20
|
"target", "vendor", "testdata", ".svn", ".hg", ".gradle", ".cache",
|
|
21
|
+
".venv", "venv", ".tox", "site-packages", "__pycache__", ".mypy_cache",
|
|
21
22
|
]);
|
|
22
23
|
|
|
23
24
|
const MAGIC_BYTES = 8; // enough for every signature we sniff
|
|
@@ -38,6 +39,13 @@ function inspectFile(fp, kind, detectOnly, opts = {}) {
|
|
|
38
39
|
const actual = sniffKind(magic.subarray(0, n));
|
|
39
40
|
if (!actual || (actual !== "elf" && actual !== kind)) return null;
|
|
40
41
|
kind = actual;
|
|
42
|
+
// ET_CORE is a process crash dump, not a library or executable. Check
|
|
43
|
+
// the ELF header before hashing (including files named core.<pid>).
|
|
44
|
+
if (kind === 'elf' && before.size >= 18 && [1, 2].includes(magic[5])) {
|
|
45
|
+
const type = Buffer.alloc(2);
|
|
46
|
+
if (fs.readSync(fd, type, 0, 2, 16) === 2 &&
|
|
47
|
+
(magic[5] === 1 ? type.readUInt16LE(0) : type.readUInt16BE(0)) === 4) return null;
|
|
48
|
+
}
|
|
41
49
|
if (detectOnly) return { kind };
|
|
42
50
|
const limit = opts.maxFileBytes ?? MAX_FILE_BYTES;
|
|
43
51
|
if (before.size > limit) throw Error(`file size ${before.size} exceeds binary scan limit ${limit} bytes`);
|
|
@@ -50,7 +58,7 @@ function inspectFile(fp, kind, detectOnly, opts = {}) {
|
|
|
50
58
|
sha1.update(chunk.subarray(0, count)); sha256.update(chunk.subarray(0, count));
|
|
51
59
|
offset += count;
|
|
52
60
|
}
|
|
53
|
-
const metadata = require("./metadata").extractMetadata(kind, fd, before.size, opts);
|
|
61
|
+
const metadata = require("./metadata").extractMetadata(kind, fd, before.size, opts.imageProducts ? { ...opts, imageBinaryName: path.basename(fp) } : opts);
|
|
54
62
|
const after = fs.fstatSync(fd);
|
|
55
63
|
if (after.size !== before.size || after.mtimeMs !== before.mtimeMs || after.ctimeMs !== before.ctimeMs)
|
|
56
64
|
throw Error("file changed during binary scan");
|
|
@@ -61,9 +69,9 @@ function inspectFile(fp, kind, detectOnly, opts = {}) {
|
|
|
61
69
|
/** Walk `dir`, return [{ path, kind, size, sha1, sha256, declaredName }]. */
|
|
62
70
|
function scanBinaries(dir, opts = {}) {
|
|
63
71
|
const { onProgress, onWarning } = opts;
|
|
64
|
-
const warn = (fp, error) => onWarning?.({ type: "dependency-coverage", reason: "binary-scan-error", ecosystem: "binary", manifestPath: fp,
|
|
72
|
+
const warn = (fp, error) => onWarning?.({ type: "dependency-coverage", reason: "binary-scan-error", ecosystem: "binary", ...(error?.code ? { code: error.code } : {}), manifestPath: fp,
|
|
65
73
|
message: `binary scan incomplete for ${fp}: ${error.message}` });
|
|
66
|
-
const { makeDirFilter } = require("../../path-filter");
|
|
74
|
+
const { makeDirFilter } = require("../../inventory/path-filter");
|
|
67
75
|
const skipDir = makeDirFilter({ srcRoot: opts.srcRoot || dir, defaultSkip: SKIP, excludePath: opts.excludePath, useDefaults: opts.defaultExcludes !== false });
|
|
68
76
|
const out = [];
|
|
69
77
|
const stack = [dir];
|
|
@@ -72,7 +80,7 @@ function scanBinaries(dir, opts = {}) {
|
|
|
72
80
|
let entries; try { entries = fs.readdirSync(cur, { withFileTypes: true }); } catch (error) { warn(cur, error); continue; }
|
|
73
81
|
for (const e of entries) {
|
|
74
82
|
const fp = path.join(cur, e.name);
|
|
75
|
-
if (e.isDirectory()) { if (!skipDir(fp, e.name)) stack.push(fp); continue; }
|
|
83
|
+
if (e.isDirectory()) { if (!skipDir(fp, e.name) && !opts.skipInventoryDir?.(fp)) stack.push(fp); continue; }
|
|
76
84
|
if (!e.isFile()) continue;
|
|
77
85
|
const ext = extKind(e.name);
|
|
78
86
|
try {
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
* @email: pp9ping@gmail.com
|
|
17
17
|
*/
|
|
18
18
|
const fs = require("fs");
|
|
19
|
-
const { makeDepRecord } = require("../../dep-record");
|
|
20
|
-
const { lifecycleStatus } = require("../../outdated");
|
|
19
|
+
const { makeDepRecord } = require("../../inventory/dep-record");
|
|
20
|
+
const { lifecycleStatus } = require("../../maintenance/outdated");
|
|
21
21
|
|
|
22
22
|
// "7.4" → [7, 4, null]; "v7.4.33-dev" → [7, 4, 33]; garbage → null
|
|
23
23
|
function parseVer(s) {
|
|
@@ -5,26 +5,17 @@
|
|
|
5
5
|
* API: https://packagist.org/packages/{vendor}/{pkg}.json
|
|
6
6
|
* → { package: { abandoned: bool|string, versions: { "<v>": {...} } } }
|
|
7
7
|
*
|
|
8
|
-
* Cached in
|
|
8
|
+
* Cached in the active VigieVuln cache for four hours.
|
|
9
9
|
*
|
|
10
10
|
* @author: N.BRAUN
|
|
11
11
|
* @email: pp9ping@gmail.com
|
|
12
12
|
*/
|
|
13
|
-
const
|
|
14
|
-
const { foldAbsent } = require("../../private-deps");
|
|
15
|
-
const path = require("path");
|
|
16
|
-
const os = require("os");
|
|
13
|
+
const { foldAbsent } = require("../../inventory/private-deps");
|
|
17
14
|
let pLimit; try { pLimit = require("p-limit"); } catch { pLimit = () => (fn) => fn(); }
|
|
18
|
-
const { authHeaderFor, normalise } = require("../../registries");
|
|
19
|
-
const { belongsToOtherComposerRegistry } = require("../../packagist
|
|
15
|
+
const { authHeaderFor, normalise } = require("../../providers/registries");
|
|
16
|
+
const { belongsToOtherComposerRegistry } = require("../../providers/packagist/audit");
|
|
20
17
|
|
|
21
|
-
const CACHE_DIR = path.join(require("../../cache-directory").getCacheDir());
|
|
22
|
-
const CACHE_PATH = path.join(CACHE_DIR, "packagist-cache.json");
|
|
23
18
|
const CACHE_MAX_AGE_MS = 4 * 3600 * 1000;
|
|
24
|
-
const API = "https://packagist.org/packages";
|
|
25
|
-
|
|
26
|
-
function loadCache() { return require('../../json-cache').load(CACHE_DIR,'packagist',{ entries: {}, meta: {} }); }
|
|
27
|
-
function saveCache(d) { require('../../json-cache').save(CACHE_DIR,'packagist',d); }
|
|
28
19
|
|
|
29
20
|
function isStable(v) { return /^\d+(\.\d+)*$/.test(String(v || "").replace(/^v/, "")); }
|
|
30
21
|
function cmp(a, b) {
|
|
@@ -112,8 +103,10 @@ async function checkComposerRegistryDeps(deps, opts = {}) {
|
|
|
112
103
|
!belongsToOtherComposerRegistry(d));
|
|
113
104
|
const result = { deprecated: [], outdated: [], licensed: [], private: [] };
|
|
114
105
|
if (!targets.length) return result;
|
|
115
|
-
const
|
|
116
|
-
const
|
|
106
|
+
const cacheDir = opts.cacheDir || require('../../cache/directory').getCacheDir();
|
|
107
|
+
const storage = require('../../cache/json');
|
|
108
|
+
const cache = storage.load(cacheDir,'packagist',{entries:{},meta:{}});
|
|
109
|
+
const fresh = (offline || !require("../../providers").hasHostedProxy()) && cache.meta?.fetchedAt && require('../../cache/policy').fresh(cache.meta.fetchedAt, CACHE_MAX_AGE_MS);
|
|
117
110
|
const previous = !fresh && !offline ? {entries:cache.entries, fetchedAt:cache.meta?.fetchedAt} : null;
|
|
118
111
|
if (!fresh && !offline) cache.entries = {};
|
|
119
112
|
const limit = pLimit(concurrency);
|
|
@@ -125,12 +118,13 @@ async function checkComposerRegistryDeps(deps, opts = {}) {
|
|
|
125
118
|
const pkg = await fetchPackage(name, { offline, registries, ...(fetcher ? { fetcher } : {}) });
|
|
126
119
|
if (pkg && !pkg.error) {
|
|
127
120
|
const f = packagistToFindings(pkg, { version: t.version });
|
|
128
|
-
ex = { abandoned: f.abandoned, latest: f.outdated?.latest || null, license: f.license || null };
|
|
121
|
+
ex = { versionChecked:Object.keys(pkg.versions || {}).some(isStable), abandoned: f.abandoned, latest: f.outdated?.latest || null, license: f.license || null };
|
|
129
122
|
cache.entries[key] = ex;
|
|
130
123
|
} else {
|
|
131
124
|
ex = { abandoned: null, latest: null, license: null, absent: pkg?.absent === true };
|
|
132
125
|
}
|
|
133
126
|
}
|
|
127
|
+
if (opts.onVersionChecked && (ex.latest || ex.versionChecked)) opts.onVersionChecked(t);
|
|
134
128
|
// Absent from EVERY configured registry: an internal package. Only a definitive
|
|
135
129
|
// 404/410 from all of them gets here — a timeout leaves it unknown and silent.
|
|
136
130
|
if (ex.absent) result.private.push({ dep: t, ecosystem: "composer" });
|
|
@@ -146,8 +140,8 @@ async function checkComposerRegistryDeps(deps, opts = {}) {
|
|
|
146
140
|
})));
|
|
147
141
|
if (!offline) {
|
|
148
142
|
if (!fresh) cache.meta = { fetchedAt: Date.now() };
|
|
149
|
-
require('../../cache
|
|
150
|
-
|
|
143
|
+
require('../../cache/policy').preserveEntries(cache, previous);
|
|
144
|
+
storage.save(cacheDir,'packagist',cache);
|
|
151
145
|
}
|
|
152
146
|
return result;
|
|
153
147
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
const fs = require("fs");
|
|
12
12
|
const path = require("path");
|
|
13
|
-
const { makeDepRecord, coordKeyFor } = require("../dep-record");
|
|
13
|
+
const { makeDepRecord, coordKeyFor } = require("../inventory/dep-record");
|
|
14
14
|
const { parseComposerLock, parseComposerJson, isConcrete } = require("./composer/parse");
|
|
15
15
|
const { readPlatformPhp } = require("./composer/platform");
|
|
16
16
|
const { versionRelationsFor } = require("./composer/relations");
|
|
@@ -37,7 +37,7 @@ function findComposerManifests(dir, skipDir = (child, name) => SKIP.has(name)) {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
function dirFilter(dir, opts) {
|
|
40
|
-
return require("../path-filter").makeDirFilter({ srcRoot: opts.srcRoot || dir, defaultSkip: SKIP, excludePath: opts.excludePath, useDefaults: opts.defaultExcludes !== false });
|
|
40
|
+
return require("../inventory/path-filter").makeDirFilter({ srcRoot: opts.srcRoot || dir, defaultSkip: SKIP, excludePath: opts.excludePath, useDefaults: opts.defaultExcludes !== false });
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
module.exports = {
|
|
@@ -97,7 +97,7 @@ module.exports = {
|
|
|
97
97
|
existing.version = d.version;
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
|
-
for (const g of findComposerManifests(dir, dirFilter(dir, opts))) {
|
|
100
|
+
for (const g of opts.manifestGroups ?? findComposerManifests(dir, dirFilter(dir, opts))) {
|
|
101
101
|
// The PHP platform requirement — a runtime verdict input, never a dep (see platform.js).
|
|
102
102
|
const platform = readPlatformPhp(g.composerLock, g.composerJson);
|
|
103
103
|
if (platform) platforms.push(platform);
|
|
@@ -136,7 +136,8 @@ module.exports = {
|
|
|
136
136
|
ranges++;
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
|
|
139
|
+
// A manifest declaring no dependency has nothing a lockfile would resolve.
|
|
140
|
+
if (pinned + ranges > 0) warnings.push({ type: "no-lockfile", manifestPath: g.composerJson, message: `composer.json without composer.lock — best-effort: ${pinned} pinned, ${ranges} range(s) skipped (run "composer install")` });
|
|
140
141
|
}
|
|
141
142
|
}
|
|
142
143
|
for (const dep of out.values()) dep.versionRelations = versionRelationsFor(dep);
|
|
@@ -151,7 +152,7 @@ module.exports = {
|
|
|
151
152
|
const { checkComposerRegistryDeps } = require("./composer/registry");
|
|
152
153
|
return checkComposerRegistryDeps(deps, opts);
|
|
153
154
|
},
|
|
154
|
-
resolveEolProduct(d) { return require("../outdated").findEolProduct(d); },
|
|
155
|
+
resolveEolProduct(d) { return require("../maintenance/outdated").findEolProduct(d); },
|
|
155
156
|
recipe: require("./recipes").composer,
|
|
156
157
|
nativeScanners: [],
|
|
157
158
|
};
|
package/lib/codecs/go/parse.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @email: pp9ping@gmail.com
|
|
10
10
|
*/
|
|
11
11
|
const fs = require("fs");
|
|
12
|
-
const { compareMavenVersions } = require("
|
|
12
|
+
const { compareMavenVersions } = require("../maven/version");
|
|
13
13
|
|
|
14
14
|
function stripV(v) { return String(v || "").replace(/^v/, ""); }
|
|
15
15
|
|
|
@@ -10,18 +10,18 @@
|
|
|
10
10
|
* @email: pp9ping@gmail.com
|
|
11
11
|
*/
|
|
12
12
|
const fs = require("fs");
|
|
13
|
-
const { foldAbsent } = require("../../private-deps");
|
|
13
|
+
const { foldAbsent } = require("../../inventory/private-deps");
|
|
14
14
|
const path = require("path");
|
|
15
15
|
const os = require("os");
|
|
16
16
|
let pLimit; try { pLimit = require("p-limit"); } catch { pLimit = () => (fn) => fn(); }
|
|
17
|
-
const { withPublic, authHeaderFor, normalise } = require("../../registries");
|
|
17
|
+
const { withPublic, authHeaderFor, normalise } = require("../../providers/registries");
|
|
18
18
|
|
|
19
|
-
const CACHE_DIR = path.join(require("../../cache
|
|
19
|
+
const CACHE_DIR = path.join(require("../../cache/directory").getCacheDir());
|
|
20
20
|
const CACHE_PATH = path.join(CACHE_DIR, "go-proxy-cache.json");
|
|
21
21
|
const CACHE_MAX_AGE_MS = 4 * 3600 * 1000;
|
|
22
22
|
|
|
23
|
-
function loadCache() { return require('../../json
|
|
24
|
-
function saveCache(d) { require('../../json
|
|
23
|
+
function loadCache() { return require('../../cache/json').load(CACHE_DIR,'go-proxy',{ entries: {}, meta: {} }); }
|
|
24
|
+
function saveCache(d) { require('../../cache/json').save(CACHE_DIR,'go-proxy',d); }
|
|
25
25
|
|
|
26
26
|
// proxy.golang.org case-encoding: uppercase letters → "!" + lowercase.
|
|
27
27
|
function escapeModule(mod) {
|
|
@@ -62,7 +62,7 @@ async function checkGoRegistryDeps(deps, opts = {}) {
|
|
|
62
62
|
const result = { deprecated: [], outdated: [], licensed: [], private: [] };
|
|
63
63
|
if (!targets.length || !allLibs) return result;
|
|
64
64
|
const cache = loadCache();
|
|
65
|
-
const fresh = (offline || !require("../../providers").hasHostedProxy()) && cache.meta?.fetchedAt && require('../../cache
|
|
65
|
+
const fresh = (offline || !require("../../providers").hasHostedProxy()) && cache.meta?.fetchedAt && require('../../cache/policy').fresh(cache.meta.fetchedAt, CACHE_MAX_AGE_MS);
|
|
66
66
|
const previous = !fresh && !offline ? {entries:cache.entries, fetchedAt:cache.meta?.fetchedAt} : null;
|
|
67
67
|
if (!fresh && !offline) cache.entries = {};
|
|
68
68
|
const limit = pLimit(concurrency);
|
|
@@ -86,7 +86,7 @@ async function checkGoRegistryDeps(deps, opts = {}) {
|
|
|
86
86
|
// fresh to the next ONLINE run and skip its refetch.
|
|
87
87
|
if (!offline) {
|
|
88
88
|
if (!fresh) cache.meta = { fetchedAt: Date.now() };
|
|
89
|
-
require('../../cache
|
|
89
|
+
require('../../cache/policy').preserveEntries(cache, previous);
|
|
90
90
|
saveCache(cache);
|
|
91
91
|
}
|
|
92
92
|
return result;
|
package/lib/codecs/go.codec.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
const fs = require("fs");
|
|
12
12
|
const path = require("path");
|
|
13
|
-
const { makeDepRecord, coordKeyFor } = require("../dep-record");
|
|
13
|
+
const { makeDepRecord, coordKeyFor } = require("../inventory/dep-record");
|
|
14
14
|
const G = require("./go/parse");
|
|
15
15
|
const { mergeVersionEvidence } = require("./version-evidence");
|
|
16
16
|
|
|
@@ -30,7 +30,7 @@ function findGoDirs(dir, skipDir = (child, name) => SKIP.has(name)) {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
function dirFilter(dir, opts) {
|
|
33
|
-
return require("../path-filter").makeDirFilter({ srcRoot: opts.srcRoot || dir, defaultSkip: SKIP, excludePath: opts.excludePath, useDefaults: opts.defaultExcludes !== false });
|
|
33
|
+
return require("../inventory/path-filter").makeDirFilter({ srcRoot: opts.srcRoot || dir, defaultSkip: SKIP, excludePath: opts.excludePath, useDefaults: opts.defaultExcludes !== false });
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
module.exports = {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* @email: pp9ping@gmail.com
|
|
22
22
|
*/
|
|
23
23
|
const { resolveLibraryAccessor, findCatalogVersion, normKey } = require("./catalog");
|
|
24
|
-
const { compareMavenVersions } = require("
|
|
24
|
+
const { compareMavenVersions } = require("../maven/version");
|
|
25
25
|
|
|
26
26
|
const COORD = "[A-Za-z0-9_.\\-]+";
|
|
27
27
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Recover an unversioned Gradle declaration from requests made elsewhere in the
|
|
2
2
|
// same project's classpaths. This is deliberately separate from Maven mediation.
|
|
3
|
-
const { resolveTransitiveDeps } = require("
|
|
3
|
+
const { resolveTransitiveDeps } = require("../maven/transitive");
|
|
4
4
|
|
|
5
5
|
const CLASSPATHS = {
|
|
6
6
|
api: ["compile", "runtime", "testCompile", "testRuntime"],
|
|
@@ -108,7 +108,7 @@ async function recoverVersionlessGradle(deps, opts = {}) {
|
|
|
108
108
|
const pins = new Map(rootDepMgmt);
|
|
109
109
|
for (const [key, version] of selected) pins.set(key, { version });
|
|
110
110
|
const resolved = await resolveTransitiveDeps(roots, {
|
|
111
|
-
...opts, effCache, rootDepMgmt: pins,
|
|
111
|
+
...opts, effCache, rootDepMgmt: pins, gradleComponents:true,
|
|
112
112
|
runtimeDependencies: cp !== "compile" && cp !== "testCompile",
|
|
113
113
|
includedScopes: cp.startsWith("test") ? ["compile", "runtime", "provided", "test"] : ["compile", "runtime", "provided"],
|
|
114
114
|
versionRequestKeys: keys,
|
|
@@ -10,17 +10,17 @@
|
|
|
10
10
|
* Parsing is lockfile-first (gradle.lockfile = resolved, authoritative) and otherwise
|
|
11
11
|
* best-effort over the build scripts + version catalog (see ./gradle/parse.js). `platform()`
|
|
12
12
|
* BOMs are surfaced in `_gradle.platformBoms` for the orchestrator to feed into the existing
|
|
13
|
-
* lib/maven
|
|
13
|
+
* lib/codecs/maven/bom.js backfill, mirroring Maven's `<scope>import</scope>` BOMs.
|
|
14
14
|
*
|
|
15
15
|
* @author: N.BRAUN
|
|
16
16
|
* @email: pp9ping@gmail.com
|
|
17
17
|
*/
|
|
18
18
|
const fs = require("fs");
|
|
19
19
|
const path = require("path");
|
|
20
|
-
const { makeDepRecord, coordKeyFor } = require("../dep-record");
|
|
20
|
+
const { makeDepRecord, coordKeyFor } = require("../inventory/dep-record");
|
|
21
21
|
const { parseGradleLockfile, parseGradleProperties, parseBuildScript } = require("./gradle/parse");
|
|
22
22
|
const { parseVersionCatalog } = require("./gradle/catalog");
|
|
23
|
-
const { compareMavenVersions } = require("
|
|
23
|
+
const { compareMavenVersions } = require("./maven/version");
|
|
24
24
|
|
|
25
25
|
const SKIP = new Set([".git", ".idea", ".vscode", "node_modules", "dist", "out", "target", "build", ".gradle", ".mvn", "bin"]);
|
|
26
26
|
const BUILD_FILES = new Set(["build.gradle", "build.gradle.kts"]);
|
|
@@ -52,7 +52,7 @@ function pinnedVersion(dep, pins) {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
function dirFilter(dir, opts) {
|
|
55
|
-
return require("../path-filter").makeDirFilter({ srcRoot: opts.srcRoot || dir, defaultSkip: SKIP, excludePath: opts.excludePath, useDefaults: opts.defaultExcludes !== false });
|
|
55
|
+
return require("../inventory/path-filter").makeDirFilter({ srcRoot: opts.srcRoot || dir, defaultSkip: SKIP, excludePath: opts.excludePath, useDefaults: opts.defaultExcludes !== false });
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
// One walk → classify every relevant Gradle file.
|
|
@@ -217,7 +217,7 @@ module.exports = {
|
|
|
217
217
|
|
|
218
218
|
// A constraint / force nothing DECLARES is a version pin, not a dependency: Gradle
|
|
219
219
|
// applies it only if something brings the module in. Same contract as a Maven
|
|
220
|
-
// <dependencyManagement>-only entry (lib/cve-match.js): flagged `managedOnly`, it pins
|
|
220
|
+
// <dependencyManagement>-only entry (lib/advisories/cve-match.js): flagged `managedOnly`, it pins
|
|
221
221
|
// transitive versions (rootDepMgmt), never seeds resolution, becomes a transitive if
|
|
222
222
|
// the graph reaches it, and is otherwise dropped by settleManagedOnly(). It used to be
|
|
223
223
|
// a DIRECT dependency carrying every CVE of the pinned version.
|
|
@@ -246,12 +246,12 @@ module.exports = {
|
|
|
246
246
|
osvPackageName(d) { return `${d.namespace || d.groupId}:${d.name || d.artifactId}`; },
|
|
247
247
|
|
|
248
248
|
async checkRegistry(deps, opts = {}) {
|
|
249
|
-
const outdated = require("../outdated");
|
|
249
|
+
const outdated = require("../maintenance/outdated");
|
|
250
250
|
const out = opts.allLibs ? await outdated.checkOutdatedDeps(deps, opts) : [];
|
|
251
251
|
const deprecated = outdated.checkObsoleteDeps(deps);
|
|
252
252
|
return { outdated: out, deprecated };
|
|
253
253
|
},
|
|
254
|
-
resolveEolProduct(d) { return require("../outdated").findEolProduct(d); },
|
|
254
|
+
resolveEolProduct(d) { return require("../maintenance/outdated").findEolProduct(d); },
|
|
255
255
|
|
|
256
256
|
recipe: require("./recipes").gradle,
|
|
257
257
|
|
package/lib/codecs/index.js
CHANGED
|
@@ -61,7 +61,7 @@ const DETECT_CONCURRENCY = 48;
|
|
|
61
61
|
// concurrency — on a high-latency filesystem (WSL/9p, network mounts) the walk is
|
|
62
62
|
// latency-bound, so issuing many readdirs at once is far faster than a serial walk.
|
|
63
63
|
async function detectCodecs(dir, opts = {}) {
|
|
64
|
-
const { makeDirFilter } = require("../path-filter");
|
|
64
|
+
const { makeDirFilter } = require("../inventory/path-filter");
|
|
65
65
|
const skipDir = makeDirFilter({ srcRoot: dir, defaultSkip: DETECT_SKIP, excludePath: opts.excludePath, useDefaults: opts.defaultExcludes !== false });
|
|
66
66
|
const codecs = allCodecs().filter(c => c.id !== "yarn");
|
|
67
67
|
const matchers = codecs.map(c => {
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
// Reconstruct Maven's per-module resolution without exporting project paths,
|
|
4
4
|
// POMs, arbitrary properties or application source.
|
|
5
|
-
const {coord}=require('./
|
|
6
|
-
const {resolveDepVersion}=require('
|
|
7
|
-
const {localChain,chainPropertyOverrides}=require('./
|
|
8
|
-
const {cleanVersion,filterVersionProperties}=require('
|
|
5
|
+
const {coord}=require('./pom');
|
|
6
|
+
const {resolveDepVersion}=require('../../advisories/cve-match');
|
|
7
|
+
const {localChain,chainPropertyOverrides}=require('./reactor');
|
|
8
|
+
const {cleanVersion,filterVersionProperties}=require('../../inventory/deps-descriptor');
|
|
9
9
|
const IDENT=/^[A-Za-z0-9_.-]+$/;
|
|
10
10
|
const EXCLUSION=/^[A-Za-z0-9_.*-]+$/;
|
|
11
11
|
const SCOPES=new Set(['compile','runtime','provided','test','system','import']);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* lib/maven
|
|
2
|
+
* lib/codecs/maven/bom.js — resolve EXTERNAL import-scope BOMs (e.g. spring-boot-dependencies)
|
|
3
3
|
* from Maven Central and backfill the versions of declared deps that the BOM manages.
|
|
4
4
|
*
|
|
5
5
|
* core.js follows LOCAL `<scope>import</scope>` BOMs (their POM is in the source tree)
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* skips it offline). Pure except for the injected/real effectivePom fetch.
|
|
16
16
|
*/
|
|
17
17
|
const transitive = require("./transitive");
|
|
18
|
-
const core = require("./
|
|
18
|
+
const core = require("./pom");
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Walk each parsed pom's LOCAL parent chain and collect the distinct EXTERNAL parent
|
|
@@ -156,7 +156,7 @@ async function resolveBomManagedVersions(boms, opts = {}) {
|
|
|
156
156
|
let eff = null;
|
|
157
157
|
try { eff = await effectivePom(bom.groupId, bom.artifactId, bom.version, opts); }
|
|
158
158
|
catch { eff = null; }
|
|
159
|
-
if (!eff || !eff.depMgmt) continue;
|
|
159
|
+
if (!eff || !eff.depMgmt) { opts.onMissingPom?.(bom); continue; }
|
|
160
160
|
const bomCoord = `${bom.groupId}:${bom.artifactId}:${bom.version}`;
|
|
161
161
|
for (const d of eff.depMgmt) {
|
|
162
162
|
if (!d.groupId || !d.artifactId) continue;
|
|
@@ -26,7 +26,7 @@ const fs = require("fs");
|
|
|
26
26
|
const path = require("path");
|
|
27
27
|
const { strFromU8 } = require("fflate");
|
|
28
28
|
const { inflateRawSync } = require("node:zlib");
|
|
29
|
-
const { makeDepRecord } = require("../../dep-record");
|
|
29
|
+
const { makeDepRecord } = require("../../inventory/dep-record");
|
|
30
30
|
|
|
31
31
|
const ARCHIVE_RE = /\.(jar|war|ear)$/i;
|
|
32
32
|
const SKIP_DIRS = new Set(["node_modules", ".git", "target", "build", "out", "dist-newstyle", ".gradle", ".m2"]);
|
|
@@ -298,7 +298,7 @@ function findArchives(dir, acc = []) {
|
|
|
298
298
|
// Parallel equivalent of findArchives — concurrent readdir so a deep tree on a
|
|
299
299
|
// high-latency filesystem isn't walked one round-trip at a time.
|
|
300
300
|
async function findArchivesAsync(dir, skipDir) {
|
|
301
|
-
const { walkDirs } = require("../../parallel-walk");
|
|
301
|
+
const { walkDirs } = require("../../inventory/parallel-walk");
|
|
302
302
|
const skip = skipDir || ((child, name) => SKIP_DIRS.has(name) || name.startsWith("."));
|
|
303
303
|
const acc = [];
|
|
304
304
|
await walkDirs(dir, {
|
|
@@ -324,10 +324,10 @@ async function findArchivesAsync(dir, skipDir) {
|
|
|
324
324
|
* @returns { deps: depRecord[], warnings: [{type,message}] }
|
|
325
325
|
*/
|
|
326
326
|
async function scanEmbeddedJars(rootDir, opts = {}) {
|
|
327
|
-
const { makeDirFilter } = require("../../path-filter");
|
|
327
|
+
const { makeDirFilter } = require("../../inventory/path-filter");
|
|
328
328
|
const useDefaults = opts.defaultExcludes !== false;
|
|
329
329
|
const base = makeDirFilter({ srcRoot: opts.srcRoot || rootDir, defaultSkip: SKIP_DIRS, excludePath: opts.excludePath, useDefaults });
|
|
330
|
-
const skipDir = (child, name) => base(child, name) || (useDefaults && name.startsWith("."));
|
|
330
|
+
const skipDir = (child, name) => base(child, name) || opts.skipInventoryDir?.(child) || (useDefaults && name.startsWith("."));
|
|
331
331
|
const archives = await findArchivesAsync(rootDir, skipDir);
|
|
332
332
|
const ctx = {
|
|
333
333
|
out: [],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* lib/maven
|
|
2
|
+
* lib/codecs/maven/license.js — best-effort Maven license detection, network-free.
|
|
3
3
|
*
|
|
4
4
|
* A declaring POM only lists a dependency's coordinate, not its license — the
|
|
5
5
|
* license lives in the dependency's OWN POM on Maven Central. transitive.js
|
|
@@ -43,7 +43,7 @@ function collectMavenLicenses(resolved, opts = {}) {
|
|
|
43
43
|
if (dep.ecosystem !== "maven" || !dep.version) continue;
|
|
44
44
|
const p = cachedPomPath(dep.namespace || dep.groupId, dep.name || dep.artifactId, dep.version, cacheDir);
|
|
45
45
|
let xml;
|
|
46
|
-
xml = require('
|
|
46
|
+
xml = require('../../providers/maven/cache').read(p)?.value;
|
|
47
47
|
if(!xml || xml==='__NOT_FOUND__')continue;
|
|
48
48
|
const names = licensesFromPomXml(xml);
|
|
49
49
|
if (names.length) out.push({ dep, licenses: names, source: "pom" });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* lib/
|
|
2
|
+
* lib/codecs/maven/pom.js — pure logic for parsing and cleaning Maven POMs.
|
|
3
3
|
* No CLI, no console formatting. Callers pass options explicitly.
|
|
4
4
|
*
|
|
5
5
|
* @author: N.BRAUN
|
|
@@ -80,13 +80,13 @@ function findPomFiles(dir, skipDir = defaultPomSkip) {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
return out;
|
|
83
|
+
return out.sort();
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
// Parallel equivalent of findPomFiles — same result, but readdir runs concurrently
|
|
87
87
|
// so the walk isn't serialized one round-trip at a time on a high-latency filesystem.
|
|
88
88
|
async function findPomFilesAsync(dir, skipDir = defaultPomSkip) {
|
|
89
|
-
const { walkDirs } = require("
|
|
89
|
+
const { walkDirs } = require("../../inventory/parallel-walk");
|
|
90
90
|
const out = [];
|
|
91
91
|
await walkDirs(dir, {
|
|
92
92
|
skipDir,
|
|
@@ -94,13 +94,14 @@ async function findPomFilesAsync(dir, skipDir = defaultPomSkip) {
|
|
|
94
94
|
for (const e of entries) if (e.isFile() && e.name === "pom.xml") out.push(path.join(cur, e.name));
|
|
95
95
|
},
|
|
96
96
|
});
|
|
97
|
-
return out;
|
|
97
|
+
return out.sort();
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
function newMetadataStore() {
|
|
101
101
|
return {
|
|
102
102
|
byPath: {},
|
|
103
103
|
byId: {},
|
|
104
|
+
duplicateGavs: new Set(),
|
|
104
105
|
excludedById: {},
|
|
105
106
|
missingById: {},
|
|
106
107
|
anyMissingById: {},
|
|
@@ -181,7 +182,11 @@ async function parsePom(pomPath, allPomMetadata) {
|
|
|
181
182
|
// "undefined:foo" lookup collisions across POMs.
|
|
182
183
|
if (groupId && artifactId) {
|
|
183
184
|
allPomMetadata.byId[`${groupId}:${artifactId}`] = descr;
|
|
184
|
-
if (version)
|
|
185
|
+
if (version) {
|
|
186
|
+
const gav = `${groupId}:${artifactId}:${version}`;
|
|
187
|
+
if (allPomMetadata.byId[gav] && allPomMetadata.byId[gav].pomPath !== pomPath) allPomMetadata.duplicateGavs?.add(gav);
|
|
188
|
+
allPomMetadata.byId[gav] = descr;
|
|
189
|
+
}
|
|
185
190
|
}
|
|
186
191
|
allPomMetadata.byPath[pomPath] = descr;
|
|
187
192
|
return descr;
|
|
@@ -191,16 +196,18 @@ function resolveParentPath(pomPath, parentInfo, allPomMetadata) {
|
|
|
191
196
|
const self = allPomMetadata.byPath[pomPath];
|
|
192
197
|
if (!parentInfo) return null;
|
|
193
198
|
|
|
194
|
-
|
|
195
|
-
|
|
199
|
+
const rel = (parentInfo.relativePath ?? "../pom.xml").trim();
|
|
200
|
+
if (rel) {
|
|
196
201
|
let resolved = path.resolve(path.dirname(pomPath), rel);
|
|
197
202
|
if (fs.existsSync(resolved)) {
|
|
198
203
|
// Maven appends /pom.xml when relativePath points at a directory.
|
|
199
204
|
try {
|
|
200
205
|
if (fs.statSync(resolved).isDirectory()) resolved = path.join(resolved, "pom.xml");
|
|
201
206
|
} catch { /* ignore */ }
|
|
202
|
-
|
|
203
|
-
|
|
207
|
+
const candidate = allPomMetadata.byPath[resolved];
|
|
208
|
+
if (candidate && candidate.groupId === parentInfo.groupId && candidate.artifactId === parentInfo.artifactId &&
|
|
209
|
+
(candidate.version === parentInfo.version || interpolate(candidate.version, candidate.properties) === interpolate(parentInfo.version, self.properties))) {
|
|
210
|
+
self.parentDescr = candidate;
|
|
204
211
|
return resolved;
|
|
205
212
|
}
|
|
206
213
|
}
|
|
@@ -208,11 +215,15 @@ function resolveParentPath(pomPath, parentInfo, allPomMetadata) {
|
|
|
208
215
|
|
|
209
216
|
const keyV = `${parentInfo.groupId}:${parentInfo.artifactId}:${parentInfo.version}`;
|
|
210
217
|
const key = `${parentInfo.groupId}:${parentInfo.artifactId}`;
|
|
218
|
+
if (allPomMetadata.duplicateGavs?.has(keyV)) {
|
|
219
|
+
self.ambiguousParent = keyV;
|
|
220
|
+
return null;
|
|
221
|
+
}
|
|
211
222
|
if (allPomMetadata.byId[keyV]) {
|
|
212
223
|
self.parentDescr = allPomMetadata.byId[keyV];
|
|
213
224
|
return self.parentDescr.pomPath;
|
|
214
225
|
}
|
|
215
|
-
if (allPomMetadata.byId[key]) {
|
|
226
|
+
if (!parentInfo.version && allPomMetadata.byId[key]) {
|
|
216
227
|
self.parentDescr = allPomMetadata.byId[key];
|
|
217
228
|
return self.parentDescr.pomPath;
|
|
218
229
|
}
|
|
@@ -284,7 +295,7 @@ async function getAllInheritedProps(pomPath, allPomMetadata, cache) {
|
|
|
284
295
|
// `mvn dependency:tree` reports 5.2.4.Final for that module.
|
|
285
296
|
//
|
|
286
297
|
// So: interpolate the BOM's managed entries against the BOM's properties here, at
|
|
287
|
-
// the import boundary, and drop the properties. (lib/transitive.js#effectivePom
|
|
298
|
+
// the import boundary, and drop the properties. (lib/codecs/maven/transitive.js#effectivePom
|
|
288
299
|
// already does the equivalent for EXTERNAL import BOMs.)
|
|
289
300
|
merged.dependencies.push(...imported.dependencies);
|
|
290
301
|
merged.dependencyManagement.push(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* lib/maven
|
|
2
|
+
* lib/codecs/maven/reactor.js — the Maven scan set, resolved MODULE BY MODULE.
|
|
3
3
|
*
|
|
4
4
|
* Maven never resolves "the reactor"; it resolves each module with that module's own
|
|
5
5
|
* effective model: its local parent chain, its external <parent>, the BOMs it imports, the
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* - its transitives, resolved against ITS managed versions/exclusions only.
|
|
23
23
|
* The maven-codec records are then rebuilt from that union: `versions[]`, `versionPaths`
|
|
24
24
|
* (version → declaring pom) and `maskedVersions[]` (version → resolving module, chain, scope —
|
|
25
|
-
* what lib/attribution.js narrows each match with). A coordinate no module holds leaves the
|
|
25
|
+
* what lib/findings/attribution.js narrows each match with). A coordinate no module holds leaves the
|
|
26
26
|
* scan set, whatever <dependencyManagement> mentions it.
|
|
27
27
|
*
|
|
28
28
|
* Gradle records (ecosystemType "gradle"), embedded and binary records are not touched.
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
* @author: N.BRAUN
|
|
31
31
|
* @email: pp9ping@gmail.com
|
|
32
32
|
*/
|
|
33
|
-
const core = require("./
|
|
33
|
+
const core = require("./pom");
|
|
34
34
|
const { effectivePom, resolveTransitiveDeps, fetchMetadataVersions, managedKey } = require("./transitive");
|
|
35
|
-
const { resolveDepVersion } = require("
|
|
36
|
-
const { isVersionRange, resolveVersionRange, compareMavenVersions } = require("./
|
|
35
|
+
const { resolveDepVersion } = require("../../advisories/cve-match");
|
|
36
|
+
const { isVersionRange, resolveVersionRange, compareMavenVersions } = require("./version");
|
|
37
37
|
|
|
38
38
|
const coord = core.coord;
|
|
39
39
|
const isConcrete = v => v != null && v !== "" && !/\$\{/.test(String(v)) && !isVersionRange(String(v));
|
|
@@ -146,11 +146,6 @@ async function moduleDirects(pomPath, chain, externalParent, mgmt, store, propsB
|
|
|
146
146
|
const key = `${d.groupId}:${d.artifactId}`;
|
|
147
147
|
if (opts.deps2Exclude && opts.deps2Exclude.test(d.groupId)) return; // -e: private, never scanned
|
|
148
148
|
if (/\$\{/.test(key)) return;
|
|
149
|
-
if (seen.has(key)) {
|
|
150
|
-
if (seen.get(key) !== managedKey(d)) opts.onVariantCollision?.({groupId:d.groupId,artifactId:d.artifactId});
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
seen.set(key, managedKey(d));
|
|
154
149
|
const m = mgmt.get(managedKey(d));
|
|
155
150
|
let version = d.version;
|
|
156
151
|
let versionSource = null;
|
|
@@ -161,6 +156,17 @@ async function moduleDirects(pomPath, chain, externalParent, mgmt, store, propsB
|
|
|
161
156
|
if (version && isVersionRange(String(version))) {
|
|
162
157
|
version = resolveVersionRange(version, await fetchMetadataVersions(d.groupId, d.artifactId, opts));
|
|
163
158
|
}
|
|
159
|
+
if (seen.has(key)) {
|
|
160
|
+
// A type or classifier variant (test-jar, native classifier) shares the POM
|
|
161
|
+
// and the advisory identity of its groupId:artifactId. Coverage is only at
|
|
162
|
+
// risk when the variant resolves to another version than the one retained.
|
|
163
|
+
const kept = seen.get(key);
|
|
164
|
+
const variantVersion = isConcrete(version) ? String(version) : null;
|
|
165
|
+
if (kept.variant !== managedKey(d) && (!variantVersion || kept.version !== variantVersion))
|
|
166
|
+
opts.onVariantCollision?.({groupId:d.groupId,artifactId:d.artifactId,versions:[kept.version,variantVersion]});
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
seen.set(key, { variant: managedKey(d), version: isConcrete(version) ? String(version) : null });
|
|
164
170
|
const scope = d.scope || m?.scope || "compile";
|
|
165
171
|
if (scope === "system" || scope === "import") return;
|
|
166
172
|
if (scope === "test" && !opts.includeTestDeps) return;
|
|
@@ -208,7 +214,7 @@ async function resolveModule(pomPath, store, propsByPom, opts) {
|
|
|
208
214
|
includedScopes: opts.includeTestDeps ? ["compile", "runtime", "provided", "test"] : ["compile", "runtime", "provided"],
|
|
209
215
|
});
|
|
210
216
|
} catch {
|
|
211
|
-
//
|
|
217
|
+
// Retain the collected evidence for diagnostics, but never make a failed traversal
|
|
212
218
|
// indistinguishable from a complete graph with no transitives.
|
|
213
219
|
opts.onResolutionError?.();
|
|
214
220
|
transitives = new Map();
|
|
@@ -227,7 +233,7 @@ const DEV_SCOPES = new Set(["test"]);
|
|
|
227
233
|
* effCache, makeRecord(input) (lib/dep-record#makeDepRecord)
|
|
228
234
|
*/
|
|
229
235
|
async function resolveReactor(resolved, store, propsByPom, opts = {}) {
|
|
230
|
-
const { makeDepRecord } = require("
|
|
236
|
+
const { makeDepRecord } = require("../../inventory/dep-record");
|
|
231
237
|
const o = { ...opts, includeTestDeps: opts.includeTestDeps !== false, effCache: opts.effCache || new Map() };
|
|
232
238
|
const isMavenCodec = r => r && r.ecosystem === "maven" && (r.ecosystemType || "maven") === "maven"
|
|
233
239
|
&& r.provenance !== "embedded" && r.provenance !== "binary" && r.scope !== "parent";
|