OSV
| Type | Vulnerability data format and public database |
|---|---|
| Also known as | Open Source Vulnerabilities, OSV.dev, OSV Schema |
| Launched | 5 February 2021, by Google |
| Schema version | 1.9.2 (13 October 2026) |
| Encoding | JSON |
| API | https://api.osv.dev/v1/ |
| Related | CVE, SCA, SBOM, VEX |
A request to api.osv.dev/v1/query that names a package, the registry it comes from and one version gets back the vulnerability records that OSV.dev holds for that version.1 OSV (Open Source Vulnerabilities) is the name for three things behind that answer: a JSON format for describing vulnerabilities in open source packages, the OSV.dev service that collects records in that format from many databases and indexes them, and OSV-Scanner, the command-line front end to the service.23 OSV-Scanner uses the data to match a project's list of dependencies against known flaws, a form of software composition analysis.4
Origin
Google launched OSV on 5 February 2021 with a data set of bugs that its OSS-Fuzz Fuzzing service had found in more than 380 open source projects.5 A CVE record names affected products with Common Platform Enumeration (CPE) names, and CPE version strings do not line up with the tags, release numbers and commit hashes that open source projects use, so consumers miss vulnerabilities that do affect them.5 OSV records the commit that introduced a bug and the commit that fixed it. When a maintainer does not know those commits, the service can take a test case that reproduces the bug and find them by bisection, an automated search through the commit history, then work out the affected commit ranges, tags and versions, including fixes cherry-picked onto other branches.5 Google planned to add data from language package registries such as npm and PyPI next.5
Record format
An OSV record is one JSON object. Only id and modified are required, and schema_version as well for schema versions above 1.0.0.3 The id carries a prefix for the database that owns the record: GHSA for the GitHub Security Advisory Database, PYSEC for the PyPI database, GO for the Go database, RUSTSEC for RustSec, MAL for malicious package reports and OSV for advisories that OSV.dev allocates itself, currently only from OSS-Fuzz.3 When two copies of a record share an id, the one with the later modified timestamp wins, and a withdrawn timestamp marks a record that should no longer be used.3
The aliases field lists IDs for the same flaw in other databases, so a GHSA record and a CVE that describe one bug are recognised as the same flaw. The schema treats aliases as symmetric and transitive. A Linux distribution that ships a vulnerable library inside its own package does not list the library's CVE as an alias; it uses the separate upstream field, because the records cover different packages in the supply chain.3 Severity, where present, is a CVSS vector (version 2, 3 or 4) or an Ubuntu priority.3
Affected versions
Each entry in affected names a package by ecosystem and name, with an optional Package URL. Both parts are required because the same name can mean different code: zlib on npm and zlib on PyPI are unrelated packages.3 A shortened record for a made-up npm package, fixed in version 2.4.1, reads:
{
"id": "GHSA-xxxx-xxxx-xxxx",
"modified": "2026-11-01T09:00:00Z",
"aliases": ["CVE-2026-0000"],
"affected": [{
"package": { "ecosystem": "npm", "name": "example-lib" },
"ranges": [{
"type": "SEMVER",
"events": [ { "introduced": "0" }, { "fixed": "2.4.1" } ]
}]
}]
}A range is a timeline of events. introduced starts an affected span (the value "0" sorts before every version), fixed ends it, and each event object holds exactly one of these keys. The range type says how to compare versions: SEMVER follows Semantic Versioning 2.0.0, ECOSYSTEM uses the package manager's own ordering, and GIT uses full commit hashes, which can only be compared with the repository's commit graph.3 A version is affected if it falls in any range or appears in the explicit versions list. That list is recommended in every record, so that a client can answer "is this version affected?" without code for each package manager.3
When no fixed release exists yet, a record can close a range with last_affected. The schema prefers fixed: versions above last_affected count as unaffected, so a later release that is still vulnerable goes unreported.3
OSV.dev
OSV.dev imports records from the databases that publish in the format and adds data to them: Package URLs, the list of affected commits mapped to release tags, and aliases computed across sources. Changing the aliases updates a record's modified time.2 The service is an aggregator, so errors are corrected in the source database, not on OSV.dev.2 When a source that publishes to cloud storage deletes records, OSV.dev marks them withdrawn, and it stops the import if more than 10% of records would be withdrawn at once, which guards against a broken feed.2
The API takes a package and version, a Package URL, or a commit hash, and has a batch form that checks many packages in one call. The API currently has no rate limits.6 Package names are matched exactly except where the registry treats spellings as equal: PyPI names are normalized, and NuGet and crates.io names are compared without case. Requests are case-sensitive: the registry is written PyPI, not pypi.1
curl -d '{"package": {"name": "nokogiri", "ecosystem": "RubyGems"}, "version": "1.18.2"}' \
"https://api.osv.dev/v1/query"The full database can be downloaded from the public bucket gs://osv-vulnerabilities. A modified_id.csv file at its root lists changed records newest first, so a mirror can stop reading at the first change time it has already processed.2
Malicious packages
The MAL records come from the OpenSSF Malicious Packages project, which publishes reports of malicious packages in OSV format. Its scope covers malicious packages published as typosquats, through account takeover or by Dependency confusion and typosquatting, and malicious prebuilt binaries that a package downloads or installs. A report found to be a false positive is moved to a withdrawn folder with a withdrawn time instead of being deleted.7 OSV.dev leaves a withdrawn record out of query results and still serves it by its ID.2
In SecFlash
The Threats page reports a new advisory as SF-THR-101 when it names a package version in an app's code, SF-THR-102 for a library that pages load in visitors' browsers and SF-THR-103 for a package installed on the server. A package published to attack its users is reported as SF-THR-201. Each finding links to its record on osv.dev.
See also
- Vulnerable dependencies
- Software composition analysis
- National Vulnerability Database
- Software bill of materials
- CycloneDX and SPDX
- Known Exploited Vulnerabilities catalog
- Category: Software supply chain
References
- a b "POST /v1/query". OSV.dev API documentation. Google.
- a b c d e f "FAQ". OSV.dev documentation. Google.
- a b c d e f g h i j OpenSSF (13 October 2026). "Open Source Vulnerability format", version 1.9.2. OSV Schema.
- back "OSV-Scanner". OSV-Scanner documentation. Google.
- a b c d Chang, Oliver; Lewandowski, Kim (5 February 2021). "Launching OSV - Better vulnerability triage for open source". Google Online Security Blog.
- back "API (1.0)". OSV.dev API documentation. Google.
- back "OpenSSF Malicious Packages". ossf/malicious-packages, GitHub. OpenSSF.
External links
- OSV.dev, Open Source Vulnerabilities database
- OSV-Scanner, OSV-Scanner documentation