Skip to content
>_ITDITDWeb Security Platform

By Stack

Installing and using osv-scanner: find CVEs in your dependencies

osv-scanner is a free tool that reads your lockfiles and machine-checks your dependencies for known vulnerabilities (CVEs). Install via Go/Homebrew/Scoop/Docker, scan lockfiles or containers, wire it into CI, and choose between it, npm/pnpm audit, and Dependabot — through this site's operational lens.

Published 2026-06-11 Updated 2026-06-11 7 min read

For: anyone who wants to check whether their app's dependencies hide known vulnerabilities (CVEs), especially "built it with AI's help, unsure about dependency safety." No attack steps here — only defense: inspecting your own footing (your own lockfiles).

This site's view: the right tool is decided by YOUR setup

Honestly, this site itself uses pnpm audit, not osv-scanner (this site keeps no repo on GitHub and its tree is single-npm, so the bundled audit suffices). osv-scanner becomes the right call when you have ① multiple ecosystems (npm + PyPI + Go…) ② a need for a standalone scan with no GitHub dependency ③ container images to inspect. Pick it because it fits your setup — not because it's popular.

1. What osv-scanner is

A Google-built open-source scanner written in Go. Its vulnerability data comes from OSV.dev, a cross-language open vulnerability database. The key difference from a language-specific tool like npm audit is breadth: it reads lockfiles across npm, PyPI (Python), Go, Rust, Maven (Java) and more.

Free
license / data source
Multi
npm/PyPI/Go/Rust +
OSV.dev
vulnerability data
Minutes
time to install

The mechanism is simple: it lists the versions actually resolved in your lockfile, matches each package+version against OSV, and returns the relevant CVEs and fixed versions. The fact that it reads the lockfile, not the manifest (package.json's ^ floor) matters — it lines up with the principle of judging by the running version.

2. Install it

Pick whatever fits your OS and taste — all are officially supported.

Homebrew (macOS / Linux)

brew install osv-scanner

Scoop (Windows)

scoop install osv-scanner

Go

go install github.com/google/osv-scanner/v2/cmd/osv-scanner@latest

Binary / Docker

download from releases, or ghcr.io/google/osv-scanner
Install is one line — pick one. go install needs Go 1.26+.

If you'd rather install nothing and only use it in CI, run it straight from the Docker image.

# confirm it's installed
osv-scanner --version

3. Run it

You'll mostly either "recursively scan a whole directory" or "name a lockfile."

# scan the whole project recursively (auto-detects lockfiles)
osv-scanner scan -r ./
 
# name a lockfile (npm / pnpm / yarn, etc.)
osv-scanner scan -L pnpm-lock.yaml
 
# emit JSON (to feed CI or another tool)
osv-scanner scan -L package-lock.json --format json
 
# inspect a container image
osv-scanner scan image my-app:latest

Running it via Docker (no install required):

docker run --rm -v "$(pwd):/src" ghcr.io/google/osv-scanner:latest scan -r /src

Reading the output

For each hit you get the package name, the current version, the CVE/Advisory ID, and the fixed version. There's one job: bump to the fixed version or above, update the lockfile, and re-run to confirm it's gone. To dig into a CVE (severity, exploitation status), paste the ID into the CVE/KEV lookup to see CVSS and whether it's actively exploited (KEV) in one screen.

You don't have to fix everything at once

A big list doesn't mean drop everything. Prioritize by "is it actively exploited (KEV)" times "how high is the CVSS." A mid-score under active exploitation beats a high-score path you never reach. The full approach to fixing is laid out in Next.js CVE hygiene.

4. Make it continuous (wire it into CI / cron)

Running it once by hand is pointless. It works when it runs before every build or daily via cron. osv-scanner exits non-zero when it finds a vulnerability, so dropping it into a CI step stops the build the moment a dangerous dependency slips in.

1

Add it as one CI step

Add osv-scanner scan -r ./ around your tests. A non-zero exit fails the pipeline — dangerous deps are stopped before merge.
2

On GitHub, the official Action works too

If your repo is on GitHub, google/osv-scanner-action is an option. But the standalone, GitHub-free run is exactly osv-scanner's edge.
3

No GitHub? Use cron

Run it daily on your deploy server or local cron, and ship hits to a log or email. This site runs its dependency audit before every deploy plus a daily cron (below).

5. Choosing between the tools

The right move isn't "always osv-scanner" — it's whatever is most natural for your setup.

osv-scanner fits when

  • you mix more than npm (PyPI / Go / Rust / Java, multi-language)
  • you want a GitHub-free standalone scan (cron, any CI)
  • you want to inspect a container image
  • you want to stay free, on an open data source (OSV.dev)

You don't need to force it

  • single npm/pnpm project → the bundled npm audit / pnpm audit is often enough
  • GitHub-centric work → Dependabot even opens the PRs for you
  • "because it's popular" → that's not a selection reason

In short, osv-scanner, pnpm audit, and Dependabot aren't competitors — they're different roles. Need cross-language breadth and no GitHub dependency? osv-scanner. Single npm? the bundled audit. GitHub-centric? Dependabot — and you can stack them. What matters is "always run at least one of them, automatically." Against supply-chain poisoning (like the Codecov breach or the xz-utils backdoor), continuous dependency checks are the first line of defense.

What this site does itself

This site runs its dependency self-audit via pnpm audit before every deploy plus a daily cron (high/critical fails the build and triggers an email). We didn't pick osv-scanner because this site keeps no repo on GitHub and its tree is single-npm — "free, no extra binary, no GitHub dependency" is already met by pnpm audit. That's the standard we wrote applied to ourselves, and it's part of the product's credibility. And if you just want to try it once, right now, with no install, we also ship a browser-only dependency vulnerability scanner (paste a lockfile, nothing leaves the page).

FAQ

QWhat does osv-scanner do?
A

It reads your project's lockfiles (package-lock.json / pnpm-lock.yaml, etc.), then checks the resolved dependency versions against Google's OSV.dev database for known vulnerabilities (CVEs). It is not an attack tool — it inspects your own footing, defensively.

QHow is it different from Dependabot?
A

Dependabot is a GitHub-only feature that assumes your repo lives there and opens PRs for matching CVEs. osv-scanner is a standalone binary with no GitHub dependency — run it locally, in any CI, or from cron. It fits GitHub-free setups and multi-language trees.

QIsn't npm audit / pnpm audit enough?
A

For a single npm/pnpm project, the bundled audit is often enough. osv-scanner shines when you mix npm, PyPI, Go, Rust, etc., or want a standalone scan with no extra tooling and no GitHub dependency. Its data source (OSV.dev) is free too.