osv-scanner is a free, open source threat detection & response project written in Go and released under Apache-2.0. It has 11,049 GitHub stars, 794 forks and 113 open issues, and was last pushed 4 hours ago. On this registry it ranks #6 of 12 tracked projects in Threat Detection & Response, with 5 head-to-head comparisons available.

What is osv-scanner?

OSV-Scanner is an Apache-2.0 licensed vulnerability scanner written in Go that connects a project's list of dependencies with the vulnerabilities affecting them, using data from the open OSV.dev database, and it is aimed at developers, maintainers, and security teams who need to find known vulnerabilities in the dependencies they already ship.

What it is

OSV-Scanner is a command-line tool from Google that provides an officially supported frontend to the OSV database at osv.dev and a CLI interface to the OSV-Scalibr library. It lives in the open-source security tooling ecosystem, is written in Go, licensed under Apache-2.0, and carries the topics scanner, security-audit, security-tools, and vulnerability-scanner. It reads the dependency manifests and lockfiles a project already has, maps those packages to advisories, and reports the vulnerabilities that apply.

The concrete thing it replaces is the manual work of cross-referencing a dependency list against scattered advisory sources. OSV.dev aggregates advisories from open and authoritative sources such as GitHub Security Advisories, the RustSec Advisory Database, and Ubuntu security notices, and the OSV format stores affected-version information in a machine-readable form that maps precisely onto a developer's package list. Because advisories come from an open source and anyone can suggest improvements, the resulting notifications are accurate and actionable, which shortens the time needed to resolve them.

Key capabilities

  • Recursive source directory scanning with osv-scanner scan source -r /path/to/your/dir.
  • Language coverage across C/C++, Dart, Elixir, Go, Java, JavaScript, PHP, Python, R, Ruby, and Rust.
  • Package manager coverage for npm, pip, yarn, maven, go modules, cargo, gem, composer, nuget, and others.
  • Detection of vulnerabilities in OS packages on Linux systems.
  • Container image scanning for vulnerabilities in base images and included packages.
  • Guided remediation that recommends package version upgrades based on dependency depth, minimum severity, fix strategy, and return on investment.
  • Frontend to the OSV database and CLI interface to OSV-Scalibr, which does the underlying detection work.

Who uses it and how

  • Development teams running it as a scan step against a repository's manifests and lockfiles before release.
  • Maintainers of polyglot repositories, where one run covers Go modules, npm, cargo, and maven sources at once.
  • Platform and security teams scanning container images to catch vulnerable base images and bundled packages.
  • Linux operators auditing installed OS packages against published advisories.
  • Anyone who wants vulnerability findings without running a proprietary advisory service, since the underlying data is open and community-correctable.

Getting started

The recommended method is to download a prebuilt binary for your platform from the releases page, detailed in the installation section of the documentation. Alternatively, build from source with go install github.com/google/osv-scanner/v2/cmd/osv-scanner@latest, then run osv-scanner scan source -r /path/to/your/dir.

How it compares

The facts provided name no competing scanner and no list of paid products this project replaces, so on the evidence available it stands alone in this registry. Its two named relations are internal: OSV.dev is the advisory database it reads, and OSV-Scalibr is the extensible library it uses under the hood.

When to use it — and when not to

There is no database, object storage, or mail service to operate: it is a single binary that queries a hosted public database, which keeps deployment light but also means scanning depends on OSV.dev being reachable. The instructions in this README target the V2 beta, and users on V1 must consult the separate v1 repository and documentation instead, so teams that require a frozen, non-beta interface should weigh that. It also only reports vulnerabilities in dependencies and OS or container packages — it is not a code-level static analyser for first-party logic.

project readme (upstream, from github) — read inline

OpenSSF Scorecard Checks codecov SLSA 3 GitHub Release

Use OSV-Scanner to find existing vulnerabilities affecting your project's dependencies. OSV-Scanner provides an officially supported frontend to the OSV database and CLI interface to OSV-Scalibr that connects a project’s list of dependencies with the vulnerabilities that affect them.

OSV-Scanner supports a wide range of project types, package managers and features, including but not limited to:

  • Languages: C/C++, Dart, Elixir, Go, Java, Javascript, PHP, Python, R, Ruby, Rust.
  • Package Managers: npm, pip, yarn, maven, go modules, cargo, gem, composer, nuget and others.
  • Operating Systems: Detects vulnerabilities in OS packages on Linux systems.
  • Containers: Scans container images for vulnerabilities in their base images and included packages.
  • Guided Remediation: Provides recommendations for package version upgrades based on criteria such as dependency depth, minimum severity, fix strategy, and return on investment.

OSV-Scanner uses the extensible OSV-Scalibr library under the hood to provide this functionality. If a language or package manager is not supported currently, please file a feature request.

Underlying database

The underlying database, OSV.dev has several benefits in comparison with closed source advisory databases and scanners:

  • Covering most open source language and OS ecosystems (including Git), it’s comprehensive.
  • Each advisory comes from an open and authoritative source (e.g. GitHub Security Advisories, RustSec Advisory Database, Ubuntu security notices)
  • Anyone can suggest improvements to advisories, resulting in a very high quality database.
  • The OSV format unambiguously stores information about affected versions in a machine-readable format that precisely maps onto a developer’s list of packages

The above all results in accurate and actionable vulnerability notifications, which reduces the time needed to resolve them. Check out OSV.dev for more details!

Basic installation

To install OSV-Scanner, please refer to the installation section of our documentation. OSV-Scanner releases can be found on the releases page of the GitHub repository. The recommended method is to download a prebuilt binary for your platform. Alternatively, you can use go install github.com/google/osv-scanner/v2/cmd/osv-scanner@latest to build it from source.

Key Features

For more information, please read our detailed documentation to learn how to use OSV-Scanner. For detailed information about each feature, click their titles in this README.

Please note: These are the instructions for the latest OSV-Scanner V2 beta. If you are using V1, checkout the V1 README and documentation instead.

Scanning a source directory

$ osv-scanner scan source -r /path/to/your/dir

This command will recursively scan the specified directory for any supported package files, such as package.json, go.mod, pom.xml, etc. and output any discovered vulnerabilities.

OSV-Scanner has the option of using call analysis to determine if a vulnerable function is actually being used in the project, resulting in fewer false positives, and actionable alerts.

OSV-Scanner can also detect vendored C/C++ code for vulnerability scanning. See here for details.

Supported Lockfiles

OSV-Scanner supports 11+ language ecosystems and 19+ lockfile types. To check if your ecosystem is covered, please check out our detailed documentation.

Container Scanning

OSV-Scanner also supports comprehensive, layer-aware scanning for container images to detect vulnerabilities in the following operating system packages and language-specific dependencies.

Distro Support Language Artifacts Support
Alpine OS Go
Debian Java
Ubuntu Node
Python

See the full documentation for details on support.

Usage:

$ osv-scanner scan image my-image-name:tag

screencast of html output of container scanning

License Scanning

Check your dependencies' licenses using deps.dev data. For a summary:

osv-scanner --licenses path/to/repository

To check against an allowed license list (SPDX format):

osv-scanner --licenses="MIT,Apache-2.0" path/to/directory

Offline Scanning

Scan your project against a local OSV database. No network connection is required after the initial database download. The database can also be manually downloaded.

osv-scanner --offline --download-offline-databases ./path/to/your/dir

Guided Remediation (Experimental)

[!WARNING] Guided remediation (the fix command) can be risky when run on untrusted projects. It may trigger the package manager to execute scripts or follow external registries specified in the project. Please ensure you trust the source code and artifacts before proceeding.

OSV-Scanner provides guided remediation, a feature that suggests package version upgrades based on criteria such as dependency depth, minimum severity, fix strategy, and return on investment. We currently support remediating vulnerabilities in the following files:

Ecosystem File Format (Type) Supported Remediation Strategies
npm package-lock.json (lockfile) in-place
npm package.json (manifest) relock
Maven pom.xml (manifest) override

This is available as a headless CLI command, as well as an interactive mode.

Example (for npm)
$ osv-scanner fix \
    --max-depth=3 \
    --min-severity=5 \
    --ignore-dev  \
    --strategy=in-place \
    -L path/to/package-lock.json
Interactive mode (for npm)
$ osv-scanner fix \
    -M path/to/package.json \
    -L path/to/package-lock.json
Screenshot of the interactive relock results screen with some relaxation patches selected

Data Sources and Privacy

OSV-Scanner communicates with the following external services during operation:

[OSV.dev API](https:

readme truncated — read the full docs on github

Frequently asked questions

Is osv-scanner free to use?

osv-scanner is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does osv-scanner do?

Vulnerability scanner written in Go which uses the data provided by https://osv.dev

What is osv-scanner written in?

osv-scanner is primarily written in Go. Its source is publicly available at https://github.com/google/osv-scanner, and it has 11,049 GitHub stars.