Auditing npm package-lock.json vs. package.json for SBOMs, Hashes & Copyleft
Why auditing bare package.json creates massive OSV CVE blindspots (13/14 zero-CVE false negatives in our N=30 study) and how package-lock.json restores SHA-512 integrity, transitive trees & SPDX metadata.
Notice: Informational engineering guidance for security & procurement readiness — not legal advice. Backed by live telemetry from our N=30 B2B SaaS SBOM Supply-Chain Benchmark.
Zero Telemetry · Strict CSP (connect-src 'none')
1. Compliance Scope, Stack & Current Controls
SOC 2 · VSAQ · EO 14028 · EU CRA
Target Compliance & Procurement Frameworks
Language Ecosystems & Packaging Formats
Current Engineering & SBOM Controls (Check What You Have Today)
Disclaimer: Informational engineering guidance for security & procurement preparation — not legal advice.
SBOM-CORE-01: Commit deterministic lockfiles across all production servicesCRITICAL ACTION
[Pinning & Lockfiles] Unpinned manifests blind static CVE scanners: in RungLab's N=30 SBOM benchmark, 14/30 (46.7%) repos relied on floating SemVer ranges (937 specs), masking CVEs until lockfile resolution.
SBOM-CORE-02: Emit CycloneDX 1.5/1.6 or SPDX 2.3 JSON with PURLs & SHA-256 digestsCRITICAL ACTION
[SBOM Artifacts] Generate release SBOMs via `syft` or `@cyclonedx/cdxgen` from resolved lockfiles/images. In RungLab's N=30 audit, 24/30 (80.0%) raw manifest scans had zero SHA-256 hashes.
[License Governance] Check transitive deps before legal redlines: 20.0% (6/30) of benchmarked repos triggered weak/strong copyleft flags (including AGPL-3.0-or-later via mupdf in SaaS code) and 100% had unknown licenses in raw manifests.
SBOM-CORE-05: Sign releases and SBOMs with Sigstore Cosign or SLSA v1 provenanceMEDIUM ACTION
[Artifact Provenance] Attach keyless GitHub Actions OIDC Cosign signatures (`id-token: write`) and SLSA provenance so buyers can verify SBOM integrity.
[SOC 2 Type II] Auditors require repeatable evidence over an observation window: retain timestamped release SBOMs (CC8.1 change management), OSV/KEV scan logs + patch PRs (CC7.1 vulnerability management), and third-party open-source inventory (CC9.2).
FW-VSAQ-SIG: Pre-package VSAQ / SIG Lite open-source inventory & copyleft attestationHIGH ACTION
[VSAQ / SIG Lite] Enterprise buyers ask whether you maintain a complete FOSS bill of materials, patch critical CVEs within SLA, and prohibit unapproved copyleft components. Pair a CycloneDX SBOM with pre-filled VSAQ/SIG answers.
[Cloud SaaS Distribution] While GPL-2.0/3.0 typically triggers on binary distribution, AGPL-3.0 requires source disclosure over network interaction — flagged in SaaS PDF/document stacks like mupdf (AGPL-3.0-or-later).
ECO-NPM: Audit resolved package-lock.json / pnpm-lock.yaml — never bare package.jsonCRITICAL ACTION
[Node.js / npm] Ensure `package-lock.json` integrity hashes are intact and generate CycloneDX (`@cyclonedx/cyclonedx-npm`) from lockfiles to surface transitive MPL-2.0/EPL-2.0/AGPL-3.0 packages.
In our N=30 B2B SaaS SBOM Benchmark, 46.7% of open-core repos failed procurement gates (2/30 shipped CISA KEVs). Run a free zero-upload scan at sbom.runglab.dev, order the $39 6-File SOC 2 & VSAQ/SIG Dossier (Creem or PayPal invoice-on-delivery via [email protected]), or automate via Official MCP Server dev.runglab/devtools (audit_sbom_manifest).
Generate Pinned CycloneDX 1.6 SBOM from npm package-lock.json
npm-sbom-audit.sh
# 1. Enforce lockfile integrity in CI (never npm install in prod build)
npm ci --ignore-scripts
# 2. Generate CycloneDX 1.6 SBOM directly from resolved lockfile tree
npx @cyclonedx/cyclonedx-npm --output-format JSON --spec-version 1.6 --output-file sbom.cdx.json
# 3. Verify npm registry & Sigstore provenance signatures
npm audit signatures
Audit Your package-lock.json Zero-Upload in Seconds
audit-npm-lockfile.txt
# 1. Drop package-lock.json directly into https://sbom.runglab.dev (100% browser-parsed)
# -> Computes live OSV CVEs, CISA KEV matches, SHA-512 hash ratio & copyleft flags
# 2. Or call Official MCP Registry dev.runglab/devtools -> audit_sbom_manifest
Key Engineering & Procurement Takeaways
RungLab's N=30 SBOM benchmark uncovered a stark empirical split: 6/6 (100%) package-lock.json scans uncovered live OSV CVEs (387 total CVEs) and transitive copyleft hits, while 13/14 bare package.json scans returned 0 CVEs solely due to unpinned SemVer ranges.
package-lock.json v2/v3 already records resolved transitive versions, npm registry integrity SHA-512 digests, and declared SPDX license fields.
Do not confuse `npm audit` alone with an enterprise procurement SBOM — buyers want CycloneDX/SPDX + license attribution + CISA KEV mapping.
Common Deal-Blocking Pitfalls to Avoid
Adding `package-lock.json` to `.gitignore` or scanning `package.json` alone in procurement compliance checks.
Running `npm install` instead of `npm ci` in release builds, silently drifting resolved transitive versions away from the audited lockfile.
Overlooking `dev` vs `runtime` scope separation in Next.js/monorepo lockfiles when triaging critical CVEs.
How B2B SaaS engineering teams satisfy AICPA SOC 2 Type II auditors across CC7.1 vulnerability monitoring, CC8.1 release change management, and CC9.2 vendor supply-chain risk using automated SBOMs.
Concrete engineering answers and evidence templates for Google VSAQ, Shared Assessments SIG Lite, and CSA CAIQ questionnaire sections covering SBOMs, third-party CVE SLAs, and copyleft governance.
Which SBOM format do Fortune 500 InfoSec teams, legal departments, and US/EU regulators prefer? Practical procurement tradeoffs between CycloneDX 1.5/1.6 and SPDX 2.3 (ISO/IEC 5962).
Vulnerability ManagementCISA KEV · BOD 22-01/26-04
How to operationalize CISA Known Exploited Vulnerabilities (KEV) gating, BOD 22-01/26-04 remediation deadlines, and VEX non-affected justifications before enterprise buyer audits.
Engineering preparation for EU CRA Annex I technical obligations: machine-readable top-level SBOMs, security update tracking across the support lifecycle, and 24h/72h ENISA reporting workflows.
Exact breakdown of the 7 NTIA SBOM Minimum Elements data fields, automation support requirements, and how to stop NOASSERTION and missing PURLs from failing federal/regulated vendor reviews.
Why did 13 of 14 package.json repos in the N=30 study show 0 CVEs?
Because raw package.json files list floating version ranges like `^4.18.0` (928 floating specs across those 14 repos) rather than exact resolved versions, preventing deterministic OSV vulnerability matching without a lockfile.
Should we include devDependencies in customer-facing SBOMs?
Include production/runtime dependencies (`--omit dev`) for deployed runtime SBOMs, or label `scope: optional/excluded` clearly in CycloneDX so buyers distinguish build tooling from shipped production code.
Does sbom.runglab.dev upload our private package-lock.json?
No. Manifest parsing, hash checking, and SPDX license scoring run client-side in your browser; only anonymized open-source package name/version pairs are queried against api.osv.dev.