Skip to content

CVE Matching ​

List the OSV advisories filed under a package name, alongside the versions nixpkgs carries for it, with a confidence score per advisory.

GET /api/v1/vulns/:package

Path Parameters ​

ParameterTypeRequiredDescription
packagestringYesnixpkgs attribute or package name. Letters, digits, ., _, / and - only; anything else answers 400. Package-set prefixes such as python3Packages. are stripped before lookup

There are no query parameters. A query string is not read: ?version=8.4.0 returns the same body as no query at all. Version comparison uses the nixpkgs-unstable version this endpoint looks up itself, never a version supplied by the caller.

Response ​

A live response for openssl:

json
{
  "success": true,
  "data": {
    "package": "openssl",
    "normalizedName": "openssl",
    "nixpkgsVersions": {
      "nixos-25.11": { "version": "4.0.1", "status": "outdated", "vulnerable": false },
      "nixos-26.05": { "version": "4.0.3", "status": "newest", "vulnerable": false },
      "nixpkgs-unstable": { "version": "4.0.3", "status": "newest", "vulnerable": false }
    },
    "newestVersion": "4.0.3",
    "versionSource": "repology",
    "truncated": false,
    "vulnerabilities": [
      {
        "matches": [{ "product": "openssl", "ecosystem": "npm", "ranges": [{ "introduced": "0.0.1", "fixed": "1.1.0" }], "cveId": "CVE-2026-10001" }],
        "confidence": { "score": 80, "factors": ["exact_name_match", "version_in_vulnerable_range"], "level": "high" },
        "cveId": "CVE-2026-10001",
        "source": "osv",
        "ecosystem": "npm",
        "osvId": "GHSA-75w2-qv55-x7fv",
        "summary": "openssl (npm) prototype pollution",
        "severity": [{ "type": "CVSS_V3", "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N" }],
        "references": [{ "type": "ADVISORY", "url": "https://github.com/advisories/GHSA-75w2-qv55-x7fv" }]
      }
    ],
    "totalVulnerabilities": 1,
    "highConfidenceCount": 1
  },
  "timestamp": "2026-10-15T19:51:47.988Z"
}

The single advisory above belongs to an npm package that happens to be named openssl, not to the OpenSSL library. That is the expected result for a C library under the current ecosystem selection; see What is queried.

Response Fields ​

Top level (data) ​

FieldTypeDescription
packagestringThe name as requested
normalizedNamestringThe name used for the version lookup and the OSV query, with any package-set prefix removed (python3Packages.requests becomes requests)
nixpkgsVersionsobjectVersions keyed by channel: nixpkgs-unstable and the current and previous NixOS releases. Empty when no version source answered
newestVersionstring|nullNewest version the version source reports. From Repology this spans every repository it tracks, nixpkgs or not, so it can be ahead of every nixpkgs channel. Absent when no version source answered
versionSourcestring|nullrepology or nixos-search, whichever supplied nixpkgsVersions. null when neither did
degradedbooleanPresent, and true, only when versionSource is null. See Degraded responses
vulnerabilitiesarrayOne entry per OSV advisory, sorted by confidence.score descending
totalVulnerabilitiesnumberLength of vulnerabilities
highConfidenceCountnumberEntries whose confidence.level is high
truncatedbooleantrue when OSV held more pages for an ecosystem than this endpoint's bound reads (4 pages or 12 MB per ecosystem)

Channel version (nixpkgsVersions.<channel>) ​

FieldTypeDescription
versionstringVersion in that channel
statusstring|nullRepology's status for it: newest, outdated, devel and so on
vulnerablebooleanRepology's vulnerable flag. Present only when versionSource is repology, and false whenever the Repology data carries no flag, so false is not an assertion that the version is safe

Vulnerability ​

FieldTypeDescription
osvIdstringOSV identifier (GHSA-..., PYSEC-..., GO-...)
cveIdstringThe CVE alias when the record carries one, otherwise the OSV identifier
sourcestringAlways osv
ecosystemstringOSV ecosystem the advisory was found under (npm, PyPI, Go, ...)
confidenceobject{ score, factors, level }; see Confidence
matchesarrayOne { product, ecosystem, ranges, cveId } entry per affected package in the record whose name matches the query
summarystring|undefinedAdvisory summary, when OSV's record carries one
severityarray|undefinedOSV severity entries, when present
referencesarray|undefinedOSV reference objects, when present

What is queried ​

The endpoint makes two lookups and joins them.

  1. Versions. Repology (or the service's copy of it) is asked for the project; if it has no nixpkgs entry, the NixOS package search is tried, using the last segment of a dotted name. The result fills nixpkgsVersions.
  2. Advisories. OSV is queried for normalizedName in a set of ecosystems chosen from the requested name: PyPI for names containing python or starting py, npm for node or npm, RubyGems for ruby or gem, Go for go, crates.io for rust or cargo. A name matching none of these is queried in npm, PyPI and Go. These are substring tests on the requested name: django is queried in Go alone and returns nothing, while python3Packages.django is queried in PyPI as well.

No distribution ecosystem (Debian, Ubuntu, Alpine and so on) is queried, and the nixpkgs security issues are not consulted. For a C library such as curl or openssl the result is usually empty or holds an unrelated same-named language package. An empty vulnerabilities array means OSV holds nothing under that name in the ecosystems listed above; it is not evidence that the nixpkgs package is free of vulnerabilities. For CVE coverage of a C library use CVE Lookup, Nix CVEs or the nixpkgs security issues.

Confidence ​

The scoring rules are:

FactorPointsCondition
exact_name_match40An affected package in the record has exactly normalizedName
partial_name_match20One name contains the other
version_in_vulnerable_range30The nixpkgs-unstable version falls before a range's fixed event
version_fixed10The nixpkgs-unstable version is at or past a range's fixed event
critical_severity10CVSS 9.0 or above, or OSV severity CRITICAL
high_severity5CVSS 7.0 or above, or OSV severity HIGH

Each factor counts once at its strongest, not once per matching entry in the record, so the maximum score is 80 (exact_name_match + one of the version/severity factors) in practice; 100 would need every factor to fire at once. level is high at 70 or above, medium at 40 or above, and low below that.

Severity is read from the record's own CVSS v3 vector when one parses; when none does, it falls back to a GitHub-style severity word (database_specific.severity) if the record carries one. Version ranges are read as ordered introduced/fixed intervals per matching affected entry; last_affected is treated as inclusive, and an interval with no fixed event counts as still vulnerable. The full record for any entry is available from OSV Details by its osvId.

Degraded responses ​

When neither Repology nor the NixOS package search returns versions for the name, the response carries versionSource: null and degraded: true, nixpkgsVersions is empty and newestVersion is absent. OSV is still queried, so vulnerabilities can be populated. A live response for golang.org/x/crypto, with vulnerabilities truncated to its first entry:

json
{
  "success": true,
  "data": {
    "package": "golang.org/x/crypto",
    "normalizedName": "golang.org/x/crypto",
    "nixpkgsVersions": {},
    "versionSource": null,
    "degraded": true,
    "truncated": false,
    "vulnerabilities": [
      {
        "matches": [{ "product": "golang.org/x/crypto", "ecosystem": "Go", "ranges": [{ "introduced": "0", "fixed": "0.17.0" }], "cveId": "CVE-2023-48795" }],
        "confidence": { "score": 70, "factors": ["exact_name_match", "version_in_vulnerable_range"], "level": "high" },
        "cveId": "CVE-2023-48795",
        "source": "osv",
        "ecosystem": "Go",
        "osvId": "GHSA-3vm4-22fp-5rfm",
        "summary": "golang.org/x/crypto vulnerable to Terrapin Attack",
        "severity": [{ "type": "CVSS_V3", "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N" }]
      }
    ],
    "totalVulnerabilities": 58,
    "highConfidenceCount": 9
  },
  "timestamp": "2026-10-15T19:55:05.238Z"
}

The same shape is returned for a name nixpkgs does not carry at all and for one whose version lookup failed; the response does not distinguish the two. Degraded responses are served with Cache-Control: no-store and are never cached.

Errors ​

StatusBodyCause
400{"success": false, "error": "Invalid package name"}The name contains a character outside the allowed set
404{"success": false, "error": "Not found. ..."}No package segment in the path (/api/v1/vulns/)
500{"success": false, "error": "Failed to find vulnerabilities"}OSV did not answer. The endpoint fails rather than return an empty list for a package it could not check
429See Rate LimitsRate limit exceeded

Examples ​

bash
curl "https://api.vulnpatch.dev/api/v1/vulns/openssl"
curl "https://api.vulnpatch.dev/api/v1/vulns/python3Packages.requests"
javascript
async function listAdvisories(packageName) {
  const response = await fetch(
    `https://api.vulnpatch.dev/api/v1/vulns/${packageName}`
  );
  const body = await response.json();
  if (!body.success) throw new Error(body.error);

  const { data } = body;
  if (data.degraded) {
    console.warn(`No nixpkgs versions found for ${data.package}`);
  } else {
    console.log(`nixpkgs-unstable: ${data.nixpkgsVersions['nixpkgs-unstable']?.version}`);
  }

  for (const v of data.vulnerabilities) {
    console.log(`${v.osvId} (${v.ecosystem})`);
  }
}
python
import requests

def list_advisories(package_name):
    body = requests.get(
        f'https://api.vulnpatch.dev/api/v1/vulns/{package_name}'
    ).json()
    if not body['success']:
        raise RuntimeError(body['error'])

    data = body['data']
    if data.get('degraded'):
        print(f"No nixpkgs versions found for {data['package']}")
    else:
        unstable = data['nixpkgsVersions'].get('nixpkgs-unstable', {})
        print(f"nixpkgs-unstable: {unstable.get('version')}")

    for v in data['vulnerabilities']:
        print(f"{v['osvId']} ({v['ecosystem']})")

Differences from /osv ​

Aspect/osv/:package/vulns/:package
Ecosystems queriedAll OSV ecosystems, or one via ?ecosystem=Chosen from the name; defaults to npm, PyPI, Go
nixpkgs versionsNoYes, per channel
Per-advisory confidenceNoYes, scored from the matched affected entry's name, version range and severity
Name normalizationNoPackage-set prefixes stripped

Caching ​

Successful, non-degraded responses are cached at the edge for two hours, keyed on the full URL. X-Cache reads HIT or MISS; a hit also carries X-Cache-Time, and its timestamp is the time the cached response was built, not the time of the request.