Batch query known vulnerabilities
batch_query_vulnerabilitiesCheck a whole npm dependency inventory against OSV.dev in one call: pass packages: [{name, version?}], or raw package.json / package-lock / yarn.lock / pnpm-lock / CycloneDX / SPDX content via content. Large inventories are chunked automatically. Each finding has severity, summary, CVE aliases, fixedVersion and isMalware, so no per-package follow-up is needed.
Before calling anything clean, read:
unresolvedPackages/nonexistentVersions(and each result'sregistryStatus): a name or version not on npm shows vulnerabilityCount 0 just like a clean package. A version npm removed can still have real OSV findings (often malware).A
packagesentry with no version is checked against every historical version; confirm against the version actually in use before calling it vulnerable.signals(deprecated, hasInstallScripts, popularity/maintenance tiers, possibleTyposquatOf): 0 vulnerabilities can still be deprecated, abandoned or a typosquat.signalsis null for git/file/workspace/URL entries, which are not scanned.source(lockfile input):nonRegistryHostmeans the tarball comes from an unexpected host;identityMismatchmeans it is a different package/version than declared (resolvedName/resolvedVersion) and the counts describe the declared one. Treat both as lockfile tampering.Use
uniqueVulnerabilityCountfor distinct issues; raw counts can list one CVE twice.package.json input:
projectLifecycleScripts/projectLifecycleScriptRiskare the project's own install scripts; peerDependencies are skipped unlessincludePeerDependencies: true(seeignoredPeerDependencyNames);declaredSpecmarks a version resolved from a range, which can change on the next install.npm aliases are followed:
package.actualNameis the real package the data describes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | No | Raw dependency inventory content: package.json, package-lock.json, yarn.lock, pnpm-lock.yaml, CycloneDX JSON, or SPDX JSON. Use this OR `packages`, not both. | |
| packages | No | Explicit package list (1-1000 items). Use this OR `content`, not both. | |
| includeDevDependencies | No | Ignored when using `packages`; only applies when `content` is a manifest/lockfile format that distinguishes dev dependencies. | |
| includePeerDependencies | No | Ignored when using `packages`; only applies when `content` is a package.json. peerDependencies are excluded from scanning by default (see ignoredPeerDependencyNames) since a peer is often intentionally left unresolved by the consumer — set this to also check them. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| results | Yes | ||
| warnings | No | ||
| inputFormat | No | ||
| ignoredCount | No | ||
| enrichmentNote | No | ||
| queryFailureCount | No | ||
| existenceCheckNote | No | ||
| parsedPackageCount | No | ||
| unresolvedPackages | No | ||
| nonexistentVersions | No | ||
| totalVulnerabilities | Yes | ||
| projectLifecycleScripts | No | ||
| ignoredPeerDependencyNames | No | ||
| projectLifecycleScriptRisk | No | ||
| totalUniqueVulnerabilities | Yes | ||
| packagesWithVulnerabilities | Yes |