# OSV Dependency Scanner – Vulnerabilities in Lockfiles & Repos (`adamplaenitz/osv-dependency-scanner`) Actor

Check npm, PyPI, Go, Cargo, Composer and RubyGems dependencies for known vulnerabilities with OSV.dev. Paste packages or lockfiles, give file URLs or public GitHub repos. Returns advisory IDs, CVEs, CVSS severity, fixed versions and references.

- **URL**: https://apify.com/adamplaenitz/osv-dependency-scanner.md
- **Developed by:** [Adam Plänitz](https://apify.com/adamplaenitz) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 package checkeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## OSV Dependency Scanner – Vulnerabilities in Lockfiles & Repos

**Check your dependencies for known security vulnerabilities with the open [OSV.dev](https://osv.dev) database: paste a list of packages or a lockfile, link to manifest files, or point it at public GitHub repositories.** You get one clean item per vulnerable package version with advisory IDs (GHSA, PYSEC, GO, RUSTSEC …), CVE aliases, CVSS score and severity, a short summary, the fixed versions and the most useful reference links. Export as JSON, CSV or Excel, or connect to Google Sheets, Slack, Make, Zapier, n8n or webhooks.

### What does it do?

1. **Collects packages** from any combination of:
   - a **package list** (`npm:lodash@4.17.15`, `PyPI:requests==2.19.0`, `Go:github.com/gin-gonic/gin@v1.6.0`, package URLs like `pkg:npm/lodash@4.17.15`),
   - **pasted file content** (one manifest or lockfile),
   - **file URLs** (any public URL; GitHub `blob` links are converted to raw links),
   - **public GitHub repositories** (repository root or a sub-folder via `/tree/<branch>/<folder>`).
2. **Parses** these files:

   | Ecosystem | Files |
   |---|---|
   | npm | `package-lock.json` (v1–v3), `npm-shrinkwrap.json`, `yarn.lock` (classic and Berry), `package.json` |
   | PyPI | `requirements.txt` (pinned `==` lines), `poetry.lock`, `uv.lock`, `pdm.lock`, `Pipfile.lock` |
   | Go | `go.mod` (direct and `// indirect` requirements) |
   | crates.io | `Cargo.lock` |
   | Packagist | `composer.lock` |
   | RubyGems | `Gemfile.lock` |

   Maven, NuGet, Pub and Hex packages can be checked via the package list.
3. **Queries OSV.dev** in batches (up to 1,000 packages per request) and loads every matching advisory.
4. **Merges duplicates** – the same vulnerability published as `PYSEC-…` and `GHSA-…` becomes one entry with all IDs.
5. **Computes** the CVSS 3.x base score from the vector, the highest severity per package, the smallest fixed version per advisory and an **upgrade hint** (the lowest version that fixes all listed advisories, as far as the advisories state).

### Who is it for?

- **Developers and DevOps teams** who want a quick vulnerability check of a project without installing a scanner.
- **Agencies and freelancers** auditing many client repositories in one run.
- **Security and compliance teams** building SBOM / dependency inventories and recurring reports (schedule the Actor and send the results to Slack, e-mail or a spreadsheet).
- **AI agents and automations** that need a simple API: "is package X version Y vulnerable?".

### Input

| Field | Default | Description |
|---|---|---|
| Packages | – | One per line: `ecosystem:name@version` (`npm`, `PyPI`, `Go`, `crates.io`, `Packagist`, `RubyGems`, `Maven`, `NuGet`, `Pub`, `Hex`; aliases such as `pip`, `cargo`, `composer`, `gem` work too), `PyPI:name==version`, or a package URL. |
| Public GitHub repositories | – | `https://github.com/owner/repo` or `https://github.com/owner/repo/tree/main/backend`. Reads the supported files in that folder. `package.json` is only used if there is no npm lockfile. |
| Manifest / lockfile URLs | – | Direct links to supported files. |
| Manifest / lockfile content | – | Paste one file; the format is detected automatically. |
| Output | only vulnerable | Or one item for every checked package including clean ones. |
| Minimum severity | any | Ignore advisories below LOW / MEDIUM / HIGH / CRITICAL. |
| Include development dependencies | yes | Where the file marks them (package.json, package-lock.json, poetry.lock, Pipfile.lock, composer.lock). |
| Include withdrawn advisories | no | |
| Output skipped entries | no | Free rows for dependencies without an exact version (unpinned requirements, git dependencies …). |
| References per advisory | 5 | Advisory and fix links first. |
| Maximum packages per run | 5,000 | Safety limit. |

### Output example (shortened)

```json
{
  "status": "vulnerable",
  "ecosystem": "PyPI",
  "name": "requests",
  "version": "2.19.0",
  "purl": "pkg:pypi/requests@2.19.0",
  "vulnerabilityCount": 5,
  "maxSeverity": "HIGH",
  "maxCvssScore": 7.5,
  "cves": ["CVE-2018-18074", "CVE-2023-32681", "CVE-2024-35195", "…"],
  "upgradeTo": "2.33.0",
  "hasUnfixedVulnerabilities": false,
  "vulnerabilities": [
    {
      "id": "GHSA-x84v-xcm2-53pg",
      "ids": ["GHSA-x84v-xcm2-53pg", "PYSEC-2018-28"],
      "aliases": ["CVE-2018-18074"],
      "cve": "CVE-2018-18074",
      "summary": "Insufficiently Protected Credentials in Requests",
      "severity": "HIGH",
      "cvssScore": 7.5,
      "cvssVector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
      "cwes": ["CWE-522"],
      "fixedVersions": ["2.20.0"],
      "fixedIn": "2.20.0",
      "published": "2018-10-09T17:29:00Z",
      "references": [{ "type": "ADVISORY", "url": "https://nvd.nist.gov/vuln/detail/CVE-2018-18074" }],
      "osvUrl": "https://osv.dev/vulnerability/GHSA-x84v-xcm2-53pg",
      "sources": [{ "database": "GitHub Advisory Database", "license": "CC-BY 4.0" }, { "database": "PyPI Advisory Database (PyPA)", "license": "CC-BY 4.0" }]
    }
  ],
  "dev": false,
  "foundIn": ["input"],
  "attribution": "Vulnerability data from OSV.dev …"
}
```

Inputs that cannot be read (unknown format, file not found, package spec without ecosystem) get a row with `status: "error"` – **free of charge**. A run summary (sources, packages per file, advisories by severity) is saved as `RUN-SUMMARY` in the key-value store.

### Pricing and speed

See the **Pricing** tab. You pay per **checked package version** (vulnerable or clean); duplicates across files are checked and charged once, error rows and skipped entries are free. Typical run times: a handful of packages ≈ 5 seconds, a repository with 400 dependencies ≈ 15 seconds.

### Data source, licence and privacy

- Data: **[OSV.dev](https://osv.dev)**, the open vulnerability database run by Google's Open Source Security Team, via its public API. OSV aggregates advisories from upstream databases, and each advisory keeps the licence of its source – for the ecosystems used here mostly **CC-BY 4.0** (GitHub Advisory Database, PyPI Advisory Database, Go Vulnerability Database) and **CC0 1.0** (RustSec). Every item carries an `attribution` field and each advisory lists its source database and licence; please keep the attribution when you republish the data.
- **This Actor is an independent tool and is not affiliated with, endorsed by or sponsored by Google, OSV.dev or the source databases.**
- Files from GitHub are read from `raw.githubusercontent.com` (public repositories only). Your files are only used for the scan; no personal data is processed.

### Limits

- Only **exact versions** can be checked. `package.json` ranges such as `^4.17.15` are checked with their lower bound (`versionFromRange: true`) – use a lockfile for exact results. Unpinned `requirements.txt` lines are skipped.
- The upgrade hint is derived from the advisories' version ranges and a generic version comparison; check it against the package's release notes.
- OSV covers published advisories only – no static code analysis, no licence check, no reachability analysis.
- `pnpm-lock.yaml`, `pom.xml`, `build.gradle` and `.csproj` files are not parsed yet (use the package list for these ecosystems).

Questions or feature requests? Please open an issue in the **Issues** tab.

# Actor input Schema

## `packages` (type: `array`):

One package version per line: ecosystem:name@version, e.g. npm:lodash@4.17.15, npm:@babel/traverse@7.22.0, PyPI:requests==2.19.0, Go:github.com/gin-gonic/gin@v1.6.0, crates.io:time@0.1.43, Packagist:guzzlehttp/guzzle@7.4.0, RubyGems:nokogiri@1.10.0, Maven:org.apache.logging.log4j:log4j-core@2.14.1, NuGet:Newtonsoft.Json@12.0.1. Package URLs (pkg:npm/lodash@4.17.15) also work. Via the API you can also pass objects { ecosystem, name, version }.

## `githubRepos` (type: `array`):

Repository URLs such as https://github.com/owner/repo or a sub-folder https://github.com/owner/repo/tree/main/backend. The Actor reads package-lock.json, yarn.lock, package.json (only without an npm lockfile), poetry.lock, uv.lock, Pipfile.lock, requirements.txt, go.mod, Cargo.lock, composer.lock and Gemfile.lock from that folder via raw.githubusercontent.com. Private repositories are not supported.

## `manifestUrls` (type: `array`):

Direct links to public manifest or lockfiles. GitHub blob links are converted to raw links automatically. The format is detected from the file name or content.

## `manifestText` (type: `string`):

Paste the content of one file: package-lock.json, yarn.lock, package.json, requirements.txt, poetry.lock, uv.lock, Pipfile.lock, go.mod, Cargo.lock, composer.lock or Gemfile.lock. The format is detected automatically.

## `manifestFileName` (type: `string`):

Helps the format detection, e.g. requirements.txt or Cargo.lock. Usually not needed.

## `outputMode` (type: `string`):

Only vulnerable package versions (default), or one item for every checked package including clean ones. Billing is per checked package in both modes.

## `minSeverity` (type: `string`):

Ignore advisories below this severity. Advisories without any severity information and malicious-package reports are always kept.

## `includeDev` (type: `boolean`):

Also check devDependencies / dev groups where the file marks them (package.json, package-lock.json, Pipfile.lock, poetry.lock, composer.lock).

## `includeWithdrawn` (type: `boolean`):

OSV keeps advisories that were withdrawn by their source. They are hidden by default.

## `includeSkipped` (type: `boolean`):

Adds free rows for dependencies that could not be checked because the file has no exact version (e.g. unpinned requirements, git dependencies, version ranges).

## `maxReferences` (type: `integer`):

Maximum number of reference links per advisory (advisories and fixes first).

## `maxPackages` (type: `integer`):

Safety limit for the number of unique package versions checked in one run.

## Actor input object example

```json
{
  "packages": [
    "npm:lodash@4.17.15",
    "PyPI:requests==2.19.0",
    "Go:github.com/gin-gonic/gin@v1.6.0",
    "crates.io:time@0.1.43",
    "Packagist:guzzlehttp/guzzle@7.4.0",
    "RubyGems:nokogiri@1.10.0"
  ],
  "outputMode": "vulnerable",
  "minSeverity": "any",
  "includeDev": true,
  "includeWithdrawn": false,
  "includeSkipped": false,
  "maxReferences": 5,
  "maxPackages": 5000
}
```

# Actor output Schema

## `results` (type: `string`):

One item per vulnerable package version (or per checked package), plus free rows for input errors.

## `summary` (type: `string`):

Sources read, packages checked, vulnerable packages, advisories by severity and API requests.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "packages": [
        "npm:lodash@4.17.15",
        "PyPI:requests==2.19.0",
        "Go:github.com/gin-gonic/gin@v1.6.0",
        "crates.io:time@0.1.43",
        "Packagist:guzzlehttp/guzzle@7.4.0",
        "RubyGems:nokogiri@1.10.0"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("adamplaenitz/osv-dependency-scanner").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "packages": [
        "npm:lodash@4.17.15",
        "PyPI:requests==2.19.0",
        "Go:github.com/gin-gonic/gin@v1.6.0",
        "crates.io:time@0.1.43",
        "Packagist:guzzlehttp/guzzle@7.4.0",
        "RubyGems:nokogiri@1.10.0",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("adamplaenitz/osv-dependency-scanner").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "packages": [
    "npm:lodash@4.17.15",
    "PyPI:requests==2.19.0",
    "Go:github.com/gin-gonic/gin@v1.6.0",
    "crates.io:time@0.1.43",
    "Packagist:guzzlehttp/guzzle@7.4.0",
    "RubyGems:nokogiri@1.10.0"
  ]
}' |
apify call adamplaenitz/osv-dependency-scanner --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,adamplaenitz/osv-dependency-scanner"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/ICoY6XDuUrbJpC9Uf/builds/qCXNaFld3Up948lKc/openapi.json
