Dependency scanners are only as good as the vulnerability data behind them, and CVE records written for products rarely say precisely which package versions in npm, PyPI or Maven are affected. OSV (Open Source Vulnerability) addresses this with an OpenSSF schema that describes affected packages and version ranges in machine-readable form, and OSV.dev, a free aggregated database and API that collects advisories from GitHub, language ecosystems and Linux distributions. This guide explains what the OSV schema, OSV.dev, the GitHub Advisory Database (GHSA) and OSV-Scanner each do, how defenders use them, how to deploy them safely in pipelines, and when other sources fit better. It is for vulnerability management, AppSec and platform teams, and complements the broader Open Source Security Guide.
This is an independent guide from NHI Mgmt Group, based on OSV.dev's public documentation as of November 2026. It is not sponsored or reviewed by OSV.dev. Product features change, so confirm settings against OSV.dev's current documentation.
Key takeaways
- OSV is a format first. The OSV schema (version 1.9.2, dated 13 October 2026) gives each advisory precise
affectedpackage names, ecosystems and version ranges, which is what makes automated matching accurate. - OSV.dev aggregates many sources. GHSA, Go, PyPI, RustSec, the OpenSSF Malicious Packages repository, Linux distributions and converted NVD CVEs are searchable through one API and bulk download.
- Aliases link the same flaw across IDs. A CVE, a GHSA and an ecosystem ID can describe one vulnerability; deduplicate on
aliasesor you will triage it three times. - Malicious packages are a separate class.
MALrecords and GHSA malware advisories have no fixed version: the response is removal and credential rotation, not upgrade. - Scanning leaks your dependency list unless you choose otherwise. Online queries send package names and versions to the API; OSV-Scanner's offline mode keeps them local.
What the tool does
"OSV" refers to three related things, and confusing them causes most design mistakes.
| Component | What it is | Who runs it | Typical use |
|---|---|---|---|
| OSV schema | JSON interchange format for vulnerabilities in open source packages, maintained under OpenSSF | Any database can export it | Publishing and consuming advisories in one format |
| OSV.dev | Aggregated database, web UI and API (/v1/query, /v1/querybatch, /v1/vulns/{id}) plus bulk exports | Google-run open source service | Looking up a package version, enriching SBOMs, bulk mirroring |
| OSV-Scanner | Officially supported CLI and Go library that matches lockfiles, SBOMs, directories and container images against OSV data | You, in CI or locally | Dependency scanning with SARIF, JSON, SPDX or CycloneDX output |
| GitHub Advisory Database (GHSA) | GitHub's advisory database, published as OSV JSON; one of OSV.dev's sources | GitHub, with community contributions | Feeds Dependabot alerts; reviewed advisories with ecosystem mapping |
The schema fields that matter
- id, modified and schema_version: the only required fields. IDs use a database prefix such as
GHSA,GO,PYSEC,RUSTSEC,MALorCVE, and the schema recommends that new IDs be semantically neutral (no severity or package name in the ID). - affected[].package:
ecosystemandname, with an optional Package URL (purl), which is how scanners match exactly rather than guessing from product names. - affected[].ranges: type
SEMVER,ECOSYSTEM(ordering defined by the ecosystem) orGIT(commit hashes), with eventsintroduced(where"0"means all earlier versions),fixed,last_affectedandlimit. - aliases, upstream and related:
aliasesare the same vulnerability under another ID (symmetric and transitive);upstreampoints from a distribution advisory to the original flaw;relatedcovers looser links. - severity: typed scores,
CVSS_V2,CVSS_V3,CVSS_V4orUbuntupriority, with an optionalsourceofNVD,CNAorSELF. - withdrawn: a timestamp marking an advisory that should no longer be used. Bulk exports include withdrawn records, so consumers must filter them.
Minor schema versions only add fields, so a client built for an older 1.x version can process newer records by ignoring unknown fields. For how OSV relates to CVE, CWE and CPE identifiers, see the CVE, CWE and CPE Guide.
Defender use cases
- Precise dependency matching: because ranges are expressed in the ecosystem's own versioning, matching a lockfile entry against OSV avoids the false positives common when product-level CPE data is applied to packages.
- Triage when the NVD lags: ecosystem databases often publish package-level ranges before or without NVD enrichment. See the CVE Programme and NVD Backlog Guide.
- SBOM enrichment: OSV-Scanner reads SPDX and CycloneDX inputs, and OSV.dev batch queries can enrich an SBOM inventory held in another platform. See the SBOM operations.
- Container image review:
osv-scanner scan image(or--archivefor an exported tar) inspects OS packages (APK, dpkg), Go and Rust binaries, Java jars,node_modulesand Python wheels, and attributes findings to image layers, which separates base image debt from application debt. - Malicious package detection: OSV.dev includes the OpenSSF Malicious Packages repository (
MALIDs), and GHSA carries malware advisories from the npm security team and that repository. When a malicious version is matched, remove it and rotate every secret it could reach. See the Malicious Package and Dependency Confusion Guide. - Remediation planning: the experimental
osv-scanner fixcommand proposes npm in-place or relock changes and Maven overrides to clear many findings with few steps. It is experimental and may change, so treat its output as a proposal for review. - Publishing your own advisories: projects and vendors can export OSV records so downstream tooling consumes them without manual mapping. See the Open Source Project Maintainer Security Guide.
Deployment and safe use
- Decide online or offline. Online scanning queries the OSV.dev API with package names and versions. For private or sensitive code, use
--offlinewith a local database: OSV-Scanner then sends no project or dependency information anywhere. Note that offline mode also disables Maven transitive resolution through deps.dev;--offline-vulnerabilitieskeeps only the vulnerability lookup local. - Mirror the data deliberately. Bulk exports live at
gs://osv-vulnerabilities/all.zipand per ecosystem at<ECOSYSTEM>/all.zip. For incremental sync, readmodified_id.csv, which is sorted newest first, until you reach a timestamp you have already processed. Point OSV-Scanner at the mirror withOSV_SCANNER_LOCAL_DB_CACHE_DIRECTORYand refresh it at least daily, or offline scans silently go stale. - Check data licences before redistributing. Sources carry different licences: OSV.dev lists GHSA, PyPI and Go data as CC-BY 4.0, RustSec as CC0 1.0, OpenSSF Malicious Packages as Apache 2.0, Ubuntu as CC-BY-SA 4.0 and Chainguard/Wolfi as CC-BY-NC-ND 4.0. Internal use is usually simple; embedding data in a commercial product needs review.
- Pilot in report-only mode. Run OSV-Scanner on a sample of repositories with
--format sariforjson, compare results against your current scanner and resolve differences (often lockfile coverage or alias duplicates) before gating builds. - Govern exceptions in configuration. Use
osv-scanner.tomlwith[[IgnoredVulns]]entries that carry areasonand aneffectiveUntilexpiry. The file applies only to its own directory, ignoring an ID also ignores its aliases, and a--configflag overrides every directory file, so review config changes in pull requests. Avoid broad[[PackageOverrides]]withignore = true. - Gate, then widen. Fail builds on new critical findings and on any
MALmatch first, then extend to high severity. Keep a documented rollback (switch the gate back to report-only) for data incidents such as a bad bulk import. - Protect the pipeline identities. The scanner job needs read access to code and, if it uploads SARIF, a findings write token. Scope both to the job. Mirror refresh jobs that hold cloud storage credentials are non-human identities too: inventory and rotate them. See the CI/CD Pipeline Identity Security Guide.
Detection and hardening value
OSV data is a detection source for supply chain risk (MITRE ATT&CK T1195.001 Compromise Software Dependencies and Development Tools) and a control input for vulnerability management.
| Framework | Reference | How OSV tooling contributes |
|---|---|---|
| NIST SP 800-53 Rev. 5 | RA-5 Vulnerability Monitoring and Scanning | Package-level scanning of code, SBOMs and images |
| NIST SP 800-53 Rev. 5 | SI-5 Security Alerts, Advisories, and Directives | Machine-readable advisory intake from many sources |
| NIST SP 800-53 Rev. 5 | CM-8 System Component Inventory; SR-3 Supply Chain Controls and Processes | Component inventory matched to known flaws and malicious packages |
| NIST CSF 2.0 | ID.AM-02; ID.RA-01; ID.RA-02 | Software inventory, vulnerability identification and intelligence intake |
| CIS Controls v8.1 | Control 7 Continuous Vulnerability Management | Automated scanning and remediation tracking for open source components |
| ISO/IEC 27001:2022 Annex A | A.8.8 Management of technical vulnerabilities | Timely information on vulnerabilities in used components |
What to monitor: scan coverage per repository and image, mirror freshness (time since last modified_id.csv sync), new MAL matches, ignore entries past expiry and findings with no fixed version.
Metrics:
- Share of production repositories and images scanned on every default-branch build.
- Mean time from OSV
publishedormodifiedtimestamp to a ticket in your tracker. - Median age of open critical and high dependency findings, after alias deduplication.
- Time from a
MALmatch to package removal and credential rotation. - Number of active ignore entries without a reason or expiry (target: zero).
Common failure patterns
- Counting aliases as separate findings: a CVE, a GHSA and a
PYSECID for one flaw inflate backlogs and confuse SLAs. - Treating malware like a vulnerability: waiting for a "fixed" version that will never exist, instead of removing the package and rotating credentials it could reach.
- Stale offline databases: air-gapped scanners that pass every build because the mirror stopped updating months ago.
- Ignoring withdrawn records incorrectly: raising alerts on withdrawn advisories from bulk data, or the opposite, losing track of a withdrawal that cleared a finding.
- Lockfile blind spots: manifests without lockfiles, vendored C/C++ code and unsupported package managers produce no results, which reads as "clean".
Alternatives
| Source or tool | Strengths | Limits | Choose it when |
|---|---|---|---|
| NVD (CVE with CPE) | Broad coverage of commercial products, CVSS enrichment | Product-level CPE matching fits packages poorly; enrichment backlog | Scanning operating systems, appliances and commercial software |
| GHSA directly | Reviewed advisories with ecosystem mapping; malware advisories; native Dependabot integration | Unreviewed advisories (imported from NVD) do not raise Dependabot alerts; covers its listed ecosystems | Code is on GitHub and Dependabot is your main workflow |
| Ecosystem databases (Go, PyPA, RustSec) | Closest to maintainers; Go data adds symbol-level detail used by govulncheck | One ecosystem each | Deep work in one language. See the Go Vulnerability Management Guide |
| OSV.dev plus OSV-Scanner | Many sources in one schema, free API and bulk data, offline mode | Data quality varies by source; licences vary | Multi-ecosystem estates wanting open, mirrorable data |
| Commercial SCA platforms | Curated data, reachability, policy and reporting | Cost; proprietary data; vendor lock-in | Large estates needing workflow and support. See the Vulnerability Management Buyer's Guide |
Small teams usually get most value from GHSA-backed alerts plus OSV-Scanner in CI. Larger organisations often mirror OSV data into a central platform so findings from SCA, SBOM tools and container scanners share one alias-aware key, and pair it with exploitation signals such as the EPSS Guide describes.
Practitioner checklist
- Decide per repository class whether online API queries are acceptable or offline mode is required.
- Mirror OSV bulk data with incremental
modified_id.csvsync and alert on stale mirrors. - Deduplicate findings on OSV
aliasesbefore measuring SLAs. - Filter withdrawn records and track withdrawals that close findings.
- Treat every
MALor malware advisory match as an incident: remove, investigate, rotate credentials. - Require
reasonandeffectiveUntilon every ignore entry and review config changes. - Confirm lockfile and image coverage, and flag repositories that produce no scan output.
- Review data licences before redistributing OSV-sourced data outside the organisation.
- Scope scanner, upload and mirror credentials to their jobs and rotate them.
Standards and references
- OpenSSF: Open Source Vulnerability format (OSV schema)
- OSV.dev: API documentation
- OSV.dev: Data sources and data dumps
- OSV-Scanner: Documentation
- GitHub Docs: About the GitHub Advisory Database
- OpenSSF: Malicious Packages repository
- NIST: SP 800-53 Rev. 5
- MITRE ATT&CK: Compromise Software Dependencies and Development Tools
Related NHI Mgmt Group resources: Open Source Security Guide · OWASP Dependency-Track Guide · VEX Guide · SARIF · Vulnerability Prioritisation Guide