feat(exposure): add any-version ("*") catalog entries in schema v0.2.0#65
Open
adel-pplx wants to merge 2 commits into
Open
feat(exposure): add any-version ("*") catalog entries in schema v0.2.0#65adel-pplx wants to merge 2 commits into
adel-pplx wants to merge 2 commits into
Conversation
A catalog entry may declare versions ["*"] to match every version of its package. tools/osvcatalog emits ["*"] for OSV affected entries whose ranges declare all versions affected (a single introduced:"0" SEMVER/ECOSYSTEM event) instead of dropping them, raising npm malicious-package coverage from ~8% to ~96% of the OSV corpus. v0.1.0 catalogs are still accepted; they cannot use "*". Fixes #64
All threat_intel catalogs and the embedded selftest catalog now declare 0.2.0, so they can be merged in one --exposure-catalog directory with generated v0.2.0 catalogs (the loader requires a uniform schema_version per directory). Entry content is unchanged; two trapdoor comments referencing "the v0.1 schema enum" are made version-neutral.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds schema v0.2.0: a catalog entry may declare
"versions": ["*"]to match every version of a package.tools/osvcatalognow emits["*"]for OSV affected entries whose ranges declare all versions affected (a singleintroduced: "0"SEMVER/ECOSYSTEM event) instead of dropping them — on the current OSV npm dump this raises coverage from ~17.9k to ~214k entries (196k any-version). v0.1.0 catalogs are still accepted and cannot use"*"; bounded ranges remain out of scope.Fixes #64
Notes: a regenerated full npm catalog is ~63.4 MiB, just under the 64 MiB default
--max-catalog-size. Catalogs in one directory must still share a singleschema_version, so a second commit bumps the shippedthreat_intel/catalogs and the embedded selftest catalog to 0.2.0 (entry content unchanged) to keep them mergeable with generated catalogs.Tests
"*"mixed with exact versions rejected,"*"under schema 0.1.0 rejected, both supported schema versions parse.["*"]while bounded and GIT-only ranges stay skipped, wildcard wins over enumerated versions for the same package, and a generated catalog round-trips throughexposure.LoadFileand matches an arbitrary version.Checks