Data Sources|||15 min read

What Is OSV? The Complete Guide to the Open Source Vulnerabilities Database

Everything you need to know about OSV (Open Source Vulnerabilities): how the API works, the advisory JSON format, all 24+ supported ecosystems, how to query it programmatically, and how vulnerability scanners use it to match packages to known CVEs. Includes an interactive lookup tool you can use right now.

What Is OSV?

OSV stands for Open Source Vulnerabilities. It is a distributed vulnerability database created by Google in 2021 that aggregates security advisories from dozens of ecosystem-specific sources into a single, machine-readable format. Unlike traditional vulnerability databases that rely on product names and vendor identifiers, OSV describes every vulnerability in terms that developers actually use: package names and version strings from their native package manager.

The central insight behind OSV is that the Common Platform Enumeration (CPE) system used by the NVD creates unnecessary ambiguity. A CPE string like cpe:2.3:a:openssl:openssl:3.0.2 could match multiple distributions of OpenSSL across different Linux distros, forks, and bundled copies. By contrast, an OSV advisory for the Alpine ecosystem's openssl package at version 3.0.2-r0 is unambiguous. There is exactly one package with that name in that ecosystem, and the version string follows Alpine's versioning scheme.

OSV is not a vulnerability reporting service. It does not assign CVE numbers, conduct original research, or evaluate severity scores. Its role is aggregation and normalization: it pulls advisories from upstream sources like the GitHub Advisory Database, RustSec, the Go Vulnerability Database, and Linux distribution security trackers, then re-publishes them in a common JSON format with a free API at api.osv.dev.

The database is fully open source, the API requires no authentication, and the data is licensed under CC-BY-4.0. This makes it one of the most accessible vulnerability data sources available to the security community.

How OSV Differs from NVD, GHSA, and Vendor Advisories

Understanding where OSV fits requires comparing it with the other major vulnerability data sources. Each serves a different purpose and uses a different identification and matching system.

FeatureOSVNVDGHSAVendor (Red Hat, Ubuntu)
Maintained byGoogle + communityNISTGitHubIndividual vendors
Identifier formatEcosystem-specific (GHSA, RUSTSEC, GO, etc.)CVE-YYYY-NNNNNGHSA-xxxx-xxxx-xxxxRHSA, USN, DSA
Package matchingExact (name + version range)CPE (product + vendor)Exact (name + version range)Exact (distro-specific)
Ecosystems covered24+All (via CPE)6 (npm, PyPI, Maven, Go, RubyGems, NuGet)1 each
API accessFree, no authFree, rate-limitedGitHub token requiredVaries
Update frequencyContinuous (minutes)Daily (often multi-day lag)ContinuousVaries by vendor
False positive riskLowHigh (CPE ambiguity)LowLow
Batch query APIYes (querybatch)NoGraphQLNo

The NVD remains the authoritative source for CVE identifiers and CVSS severity scores. However, its CPE-based matching system often produces false positives because CPE strings are ambiguous. A CPE for "curl" might match the standalone curl binary, a vendor-patched version bundled in a Linux distro, or a completely unrelated product that happens to include "curl" in its name.

GHSA (GitHub Security Advisories) is high-quality but limited to the six ecosystems GitHub supports natively. Vendor advisories like Red Hat's RHSA or Ubuntu's USN are authoritative for their respective distributions but require querying each vendor separately.

OSV's advantage is breadth plus precision: it covers 24+ ecosystems with exact package matching, all through a single API. For a deeper comparison of NVD scoring, see our guide on understanding the NVD and CVSS.

The OSV Advisory Format — Explained with Examples

Every OSV advisory is a JSON document that follows the OSV Schema specification, maintained by the Open Source Security Foundation (OpenSSF). The schema is designed to be machine-parseable while remaining human-readable. Here is a real advisory for the Log4Shell vulnerability (CVE-2021-44228), annotated with explanations:

{
  // Unique identifier — prefixed by the source database
  "id": "GHSA-jfh8-c2jp-5v3q",

  // Human-readable one-line description
  "summary": "Apache Log4j2 JNDI features do not protect against
              attacker-controlled LDAP and other JNDI related endpoints",

  // Cross-references to the same vuln in other databases
  "aliases": ["CVE-2021-44228"],

  // When this advisory was last updated
  "modified": "2024-02-16T08:18:32Z",

  // The affected packages — this is the core of the format
  "affected": [
    {
      "package": {
        "ecosystem": "Maven",                              // Package manager
        "name": "org.apache.logging.log4j:log4j-core"     // Exact Maven coordinate
      },
      "ranges": [
        {
          "type": "ECOSYSTEM",                              // Use Maven versioning
          "events": [
            { "introduced": "2.0-beta9" },                 // First vulnerable version
            { "fixed": "2.15.0" }                          // First patched version
          ]
        }
      ]
    }
  ],

  // CVSS severity vector string
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H"  // 10.0 Critical
    }
  ],

  // Links to patches, advisories, and articles
  "references": [
    { "type": "ADVISORY", "url": "https://nvd.nist.gov/vuln/detail/CVE-2021-44228" },
    { "type": "FIX", "url": "https://github.com/apache/logging-log4j2/pull/608" },
    { "type": "PACKAGE", "url": "https://central.sonatype.com/artifact/..." }
  ]
}

The key fields to understand are:

  • id — A globally unique identifier. The prefix indicates the source: GHSA- for GitHub, RUSTSEC- for Rust, GO- for Go, DLA- for Debian LTS, etc.
  • aliases — Other identifiers for the same vulnerability. This is how OSV links a GHSA advisory to its CVE number.
  • affected[].package — The ecosystem and exact package name. This is what makes OSV matching precise: there is no ambiguity about which "log4j" is affected.
  • affected[].ranges[].events — A list of version events that define the affected range. introduced marks where the vulnerability was added, fixed marks where it was patched, and last_affected (optional) marks the last known vulnerable version when no fix exists.
  • severity — Optional CVSS vector strings. Not all advisories include severity data, which is why scanners often supplement OSV with NVD CVSS scores.

A single advisory can list multiple affected packages (e.g., when the same library is published to both Maven and PyPI), and each package can have multiple affected version ranges (e.g., when a vulnerability affects both the 2.x and 3.x release lines with separate fixes).

All 24+ Supported Ecosystems

OSV aggregates vulnerability data from the following ecosystem sources. Each source maintains its own advisory database, which OSV normalizes into the common schema. Advisory counts are approximate and change daily.

Language Ecosystems

EcosystemSourceExample PackageAdvisories
npmGitHub Advisory Databaselodash3,500+
PyPIPyPI + GHSArequests2,800+
GoGo Vulnerability Databasegolang.org/x/net1,200+
MavenGitHub Advisory Databaselog4j-core4,000+
crates.ioRustSec Advisory Databasehyper800+
RubyGemsGitHub Advisory Databaserails1,500+
NuGetGitHub Advisory DatabaseNewtonsoft.Json900+
PackagistGitHub Advisory Database + FriendsOfPHPsymfony/http-kernel1,200+
HexGitHub Advisory Databasephoenix150+
PubGitHub Advisory Databasehttp100+
SwiftURLGitHub Advisory Databasevapor50+
HaskellHaskell Security Advisory DBaeson30+

Linux Distributions

EcosystemSourceExample PackageAdvisories
DebianDebian Security Trackeropenssl15,000+
UbuntuUbuntu CVE Trackercurl8,000+
AlpineAlpine SecDBbusybox2,000+
Rocky LinuxRocky Linux RLSAkernel1,500+
AlmaLinuxAlmaLinux ALSAglibc1,200+
SUSESUSE OVALpython33,000+
Photon OSVMware Photon Securitynginx800+
ChainguardChainguard Security Datago500+
WolfiWolfi Security Dataopenssl400+

Other Sources

EcosystemSourceExample PackageAdvisories
LinuxLinux Kernel CVEsKernel2,500+
AndroidAndroid Security Bulletinsplatform/frameworks/base3,000+
GSDGlobal Security DatabaseVarious500+
OSS-FuzzGoogle OSS-FuzzVarious10,000+

When a package exists in multiple ecosystems (for example, a Python library published to both PyPI and as a Debian package), OSV maintains separate advisories for each ecosystem. This means a single query for the correct ecosystem returns only the advisories relevant to your specific installation method.

How to Query the OSV API

The OSV API is a REST API at https://api.osv.dev/v1/. It requires no API key, no authentication, and supports cross-origin requests (CORS). There are three main endpoints:

Query a single package

Send a POST request to /v1/query with a package ecosystem, name, and optionally a version. If you omit the version, you get all known vulnerabilities for that package across all versions.

# Query a specific version of a package
curl -X POST https://api.osv.dev/v1/query \
  -H "Content-Type: application/json" \
  -d '{
    "package": {
      "ecosystem": "npm",
      "name": "lodash"
    },
    "version": "4.17.20"
  }'

Batch query

The batch endpoint at /v1/querybatch accepts an array of queries and returns results for each one. This is essential for vulnerability scanners that need to check hundreds of packages at once.

# Batch query multiple packages at once
curl -X POST https://api.osv.dev/v1/querybatch \
  -H "Content-Type: application/json" \
  -d '{
    "queries": [
      {
        "package": { "ecosystem": "PyPI", "name": "requests" },
        "version": "2.25.0"
      },
      {
        "package": { "ecosystem": "npm", "name": "express" },
        "version": "4.17.1"
      },
      {
        "package": { "ecosystem": "Go", "name": "golang.org/x/net" },
        "version": "0.0.0-20211209124913-491a49abca63"
      }
    ]
  }'

Get a specific vulnerability by ID

# Fetch full details for a specific advisory
curl https://api.osv.dev/v1/vulns/GHSA-jfh8-c2jp-5v3q

# Works with any ecosystem ID format
curl https://api.osv.dev/v1/vulns/RUSTSEC-2021-0078
curl https://api.osv.dev/v1/vulns/GO-2022-0969

Python example

import requests

resp = requests.post("https://api.osv.dev/v1/query", json={
    "package": {"ecosystem": "PyPI", "name": "django"},
    "version": "3.2.0"
})

for vuln in resp.json().get("vulns", []):
    severity = ""
    if vuln.get("severity"):
        severity = f" [{vuln['severity'][0].get('score', '')}]"
    print(f"{vuln['id']}: {vuln.get('summary', 'No summary')}{severity}")

# Output:
# GHSA-v6rh-hp5x-86rv: Django QuerySet.order_by() SQL injection
# GHSA-qrw5-5h28-modded: ...

JavaScript / Node.js example

const res = await fetch("https://api.osv.dev/v1/query", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    package: { ecosystem: "npm", name: "express" },
    version: "4.17.1",
  }),
});
const { vulns = [] } = await res.json();
console.log(`Found ${vulns.length} vulnerabilities`);
vulns.forEach(v => console.log(`  ${v.id}: ${v.summary}`));

For production use, keep these best practices in mind: always send batch queries when checking multiple packages (one HTTP round-trip instead of hundreds), cache responses with the modified timestamp as a cache key, and handle the case where an advisory has no severity field (not all ecosystem sources include CVSS scores).

How OSV Aggregates Vulnerability Data

OSV acts as a central aggregator, pulling advisories from upstream ecosystem sources, normalizing them into the OSV Schema, and serving them through a unified API. Here is how data flows from source to scanner:

Ecosystem SourcesGitHub GHSARustSecGo Vuln DBPyPI AdvisoryDebian TrackerAlpine SecDBUbuntu CVE+ 17 moreOSV AggregatorNormalize + Deduplicateosv.dev APIGCS Bucket ExportConsumersosv-scanner (Google)TrivyGrypeScanRookSnykCustom ScriptsCI/CD Pipelines

Each upstream source publishes advisories in its own format. OSV normalizes them into the common OSV Schema, deduplicates entries that describe the same vulnerability, and cross-links them via the aliases field. The resulting unified database is available both as an API and as bulk JSON exports in Google Cloud Storage.

Live OSV Lookup Tool

Try querying the OSV database right now. This tool sends requests directly to the api.osv.dev API from your browser — no server-side processing, no data collection. Select an ecosystem, enter a package name, and optionally a version to see all known vulnerabilities.

Results are fetched directly from the OSV API. Click any advisory ID to view full details on osv.dev. For automated scanning of container images and source archives, try ScanRook's upload scanner.

OSV vs. Other Databases — When to Use Each

No single vulnerability database covers everything. The right choice depends on what you are scanning and what kind of matching you need.

  • Use OSV when scanning application dependencies (npm packages, Python libraries, Go modules, etc.) or Linux distribution packages. OSV's ecosystem-native matching gives you the most precise results with the fewest false positives.
  • Use the NVD when you need CVE numbers, official CVSS scores, or when scanning binaries and proprietary software that do not belong to any OSV ecosystem. The NVD's CPE matching can match vulnerabilities to any software product, regardless of how it was installed. Read more in our NVD and CVSS guide.
  • Use GHSA when you are already in the GitHub ecosystem and want Dependabot alerts integrated into your pull request workflow.
  • Use vendor advisories (RHSA, USN, DSA) when you need to know whether a specific vendor-patched version resolves a vulnerability. Vendor advisories often contain backported fixes that are not reflected in upstream version numbers.

The best practice is to query multiple sources and merge the results. This is exactly what ScanRook does: it queries OSV for package-level matches, the NVD for CVE details and CVSS scores, and Red Hat OVAL for distribution-specific advisories, then produces a unified report. Learn more about how this works in our installed state vs. advisory matching article.

Frequently Asked Questions about OSV

Is the OSV API free?
Yes. The OSV API is completely free to use with no authentication required. There are no API keys, no rate limits published in the documentation, and no usage tiers. Google operates the infrastructure and makes the data available as a public good for the open source ecosystem.
Does OSV require authentication?
No. Unlike the NVD API (which rate-limits unauthenticated requests) or the GitHub Advisory API (which requires a GitHub token), the OSV API requires no authentication whatsoever. You can start querying immediately with a simple HTTP POST.
How often is OSV updated?
OSV is updated continuously. When an upstream ecosystem source publishes a new advisory, OSV typically ingests it within minutes. This is faster than the NVD, which often has a multi-day delay between a CVE being assigned and the full NVD entry being published.
What is the difference between OSV and NVD?
The NVD (National Vulnerability Database) is maintained by NIST and uses CPE identifiers to match vulnerabilities to products. OSV uses ecosystem-native package names and version ranges. OSV has lower false-positive rates for package scanning because it avoids the ambiguity of CPE matching, but NVD has broader coverage of non-open-source software.
Can I use OSV for commercial products?
Yes. OSV data is available under the CC-BY-4.0 license, which permits commercial use with attribution. The API itself has no commercial use restrictions. Many commercial vulnerability scanners, including Trivy, Grype, and ScanRook, use OSV as a primary data source.
Does OSV cover all programming languages?
OSV covers 24+ ecosystems, including all major programming languages: JavaScript (npm), Python (PyPI), Java (Maven), Go, Rust (crates.io), Ruby (RubyGems), PHP (Packagist), C# (.NET/NuGet), Dart (Pub), Elixir (Hex), and Swift. It also covers Linux distributions like Debian, Ubuntu, Alpine, and Rocky Linux.
How do I report a vulnerability to OSV?
You do not report vulnerabilities directly to OSV. Instead, you report to the upstream ecosystem source (e.g., file a GitHub Security Advisory, report to RustSec, or contact the Linux distribution's security team). OSV will automatically ingest the advisory once the upstream source publishes it.
What is an OSV ecosystem?
An ecosystem in OSV terminology is a package manager or software distribution that has its own naming and versioning scheme. For example, 'npm' is an ecosystem where packages are identified by their npm registry name. 'Debian' is an ecosystem where packages are identified by their Debian package name.
Is OSV the same as the GitHub Advisory Database?
No, but they are related. The GitHub Advisory Database (GHSA) is one of many data sources that OSV aggregates. OSV also includes data from Go Vulnerability Database, RustSec, Python Packaging Advisory Database, and over 20 other sources. GHSA data appears in OSV with GHSA- prefixed identifiers.
How does OSV handle version ranges?
OSV uses 'introduced' and 'fixed' events to define affected version ranges. The 'introduced' field marks the first vulnerable version, and 'fixed' marks the first version where the vulnerability was patched. OSV uses the ecosystem's native versioning scheme (semver for npm, PEP 440 for PyPI, etc.) to evaluate whether a given version falls within the affected range.
Can I download the entire OSV database?
Yes. Google provides a GCS (Google Cloud Storage) bucket at gs://osv-vulnerabilities that contains the entire database as individual JSON files, organized by ecosystem. You can also clone the osv.dev GitHub repository for the source code, or use the osv-scanner tool which can work with a local copy of the database.
What is osv-scanner?
osv-scanner is an official open-source tool built by Google that uses the OSV database to scan your project's dependencies for known vulnerabilities. It reads lockfiles (package-lock.json, go.sum, Cargo.lock, etc.) and checks each dependency against the OSV API. It is available at github.com/google/osv-scanner.

Further Reading

Related ScanRook articles

Scan your dependencies with ScanRook

ScanRook queries the OSV API automatically when scanning your container images, source archives, and binaries. Upload a file to get a comprehensive vulnerability report that combines OSV, NVD, and vendor advisory data in seconds.

Related Posts

More on this topic.