Skip to Content
ConceptsMatcher

Matcher

The matcher is a pure function over two tables. It has no network access and no file writes outside the findings table. It runs when either the intel or inventory table changes.

Deterministic matching

The matcher applies indicators from the intel table to items in the inventory table. An indicator matches when its condition is true:

Indicator typeCondition
package-versionPurl base matches and version is in the list
package-rangePurl base matches and version is in at least one range
file-pathThe glob matches at least one inventory path or host artifact path
file-hashSHA-256 matches a host artifact or a scanned file
file-stringThe glob matches a file and at least one string is in the file
persistenceThe glob matches a LaunchAgent plist and at least one string is in ProgramArguments
ssh-keyFingerprint matches a key in authorized_keys

The network indicator is stored but never matched locally in v1. It appears in remediation text only.

Version comparison

Version comparison is per ecosystem:

EcosystemComparator
npm, CargoSemVer 2.0
PyPIPEP 440
GoSemVer with the v prefix and pseudo-versions
RubyGemsGem::Version rules
Homebrew, cask, VS Code, DockerExact string match in v1

OSV ranges use events with introduced and fixed keys. The matcher evaluates them with the ecosystem comparator:

introduced≤version<fixed\text{introduced} \leq \text{version} < \text{fixed}

The introduced boundary is inclusive. The fixed boundary is exclusive. A lastAffected value is inclusive.

A nil introduced means version zero. A nil fixed with a lastAffected means the range ends at that version (inclusive).

Explicit versions lists use exact match, regardless of ecosystem.

File-path globs

File-path globs support:

  • * matches any sequence except /
  • ** matches any sequence including /
  • ~ expands to the home directory
  • $TMPDIR expands to the environment value

Examples:

  • **/site-packages/litellm_init.pth matches the file in any site-packages directory
  • ~/.cursor/extensions/anthropic.claude-code-*/extension.js matches the extension file with any version suffix
  • ~/Library/LaunchAgents/*.plist matches all LaunchAgent plists

The matcher walks the inventory paths and host artifact paths. It does not walk the entire home directory again.

Watchlist

The watchlist affects matching in two ways:

  1. Prefilter bypass: Articles that name a watched package go to the LLM, even when they lack a keyword.
  2. Advisory tier: Advisories with no local match still produce an advisory finding when they name a watched package.

An advisory finding has no purl and no path. It exists to show that an advisory affects a package you care about, even when it is not installed.

Exploited aliases (KEV)

A vulnerable finding rises to exploited when the matched intel ID has an alias that matches a CISA KEV CVE.

Example:

  1. OSV intel for CVE-2026-12345 produces a vulnerable finding.
  2. OSV intel carries aliases: ["CVE-2026-12345"].
  3. CISA KEV provider writes an exploited-vulnerability intel record for CVE-2026-12345.
  4. The matcher sees the alias match and raises the tier to exploited.

This mechanism lets any OSV vulnerability become exploited when KEV adds it, without duplicating the entire intel record.

Matching order

The matcher runs in this order:

  1. Package indicators against inventory items (purl + version)
  2. File-path indicators against inventory paths and host artifact paths
  3. File-hash indicators against host artifact SHA-256 values
  4. File-string indicators (glob + string search)
  5. Persistence indicators (LaunchAgent plists)
  6. SSH key indicators against baseline diffs

The matcher writes one finding per key (intel_id, purl, path). Multiple indicators on the same key produce one finding with multiple evidence lines.

Evidence format

Each match produces one evidence line in the finding:

  • package-version pkg:pypi/litellm@1.107.0
  • file-path ~/.venv/lib/python3.13/site-packages/litellm_init.pth
  • file-string ~/.cursor/extensions/anthropic.claude-code-2.1.313-darwin-arm64/extension.js: svc-telemetry
  • ssh-key SHA256:abc123...

The evidence array in a finding lists every indicator that matched on that key.

Homebrew limitation

OSV has no Homebrew ecosystem. In v1 a Homebrew item matches only intel that names the formula or cask directly, such as a trojanized cask advisory.

Upstream CVE matching through the formula source URL is planned for v2.

Last updated on