Repository navigation
ci: swap broken npm audit for OSV-Scanner + remediate transitive vulns - #5
Merged
Merged
Conversation
npm audit is unusable against the public npm registry: the advisories/bulk endpoint returns a gzip body without a Content-Encoding header, so npm fails to parse it on every npm version (npm 10 falls back to the retired quick endpoint and 400s; npm 11+ surfaces the gzip parse error). Pinning npm or using audit-ci/better-npm-audit does not help - they hit the same endpoint. Swap the audit step for google/osv-scanner-action, which reads the committed package-lock.json against the independent OSV.dev database and blocks the job on discovered vulnerabilities, keeping a real security gate. The node setup / npm ci steps are dropped since the scanner only needs the lockfile.
Bump in-range dependencies via npm update and add targeted overrides for transitive advisories that upstream ranges do not yet pull in: - tar -> ^7.5.22 (fixes critical/high in the sqlite3 -> node-gyp chain) - brace-expansion -> ^5.0.8 - @tootallnate/once -> 2.0.1 - @typescript-eslint/typescript-estree/minimatch -> 9.0.7 All production and non-bundled dev advisories are cleared. Build, lint, type-check and the full test suite remain green. The only findings left are inside npm's frozen bundledDependencies, pulled in solely by the release-time devDependency @semantic-release/npm. Those cannot be remediated by bumps or overrides from this repo and are release-only; they are surfaced for a maintainer decision.
Add osv-scanner.toml scoped to ONLY the 13 advisory IDs affecting the six packages frozen inside npm's bundledDependencies (reached solely via the release-time devDependency @semantic-release/npm -> npm): tar 7.5.11, brace-expansion 2.0.2, picomatch 4.0.3, sigstore 3.1.0, @sigstore/core 2.0.0, ip-address 10.1.0. Each ignore carries a written justification: dev/release-only, not in the shipped runtime or the build/test path, and unfixable via bump/override because bundled deps are frozen at npm's publish time. No blanket dev/ecosystem/severity ignore is used, so any new or different advisory still fails the gate. Verified: osv-scanner passes (exit 0) on this repo and still fails (exit 1) on a hypothetical unrelated high. Maintainer decision, 2026-07-26.
This was referenced Jul 26, 2026
pchuri
added a commit
that referenced
this pull request
Jul 26, 2026
The security job in ci.yml was migrated to google/osv-scanner-action in PR #5, but release.yml's own `npm audit --audit-level=high` step was missed and keeps failing (broken npm-registry advisories endpoint + real high advisories). Swap it for the identical osv-scanner step (same action version, same --lockfile arg, same repo-root osv-scanner.toml ignores), keeping the gate blocking on high/critical. release.yml is now consistent with ci.yml; semantic-release/publish config unchanged. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
|
🎉 This PR is included in version 1.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the broken
securityCI job and remediates the real vulnerabilities it was hiding.Root cause of the broken gate
npm audit --audit-level highis unusable against the public npm registry. Theadvisories/bulkendpoint returns a gzip body without aContent-Encodingheader, so npm parses raw gzip as JSON and fails on every npm version:audits/quickendpoint →400 Invalid package tree(misleading; unrelated to the lockfile).Unexpected token … is not valid JSON).Pinning npm or switching to
audit-ci/better-npm-auditdoes not help — they all hit the same broken endpoint.The swap (
ci:)Replace the
npm auditstep in thesecurityjob withgoogle/osv-scanner-action, pinned tov2.3.8. It scans the committedpackage-lock.jsonagainst the independent OSV.dev database (sidestepping the broken npm endpoint) and blocks the job on discovered vulnerabilities, preserving a real security gate. Thenode setup/npm cisteps are dropped since the scanner only needs the lockfile.Vulnerabilities fixed by bumps/overrides (
fix(deps):)The gate was legitimately red — there were real high/critical advisories in the tree. Cleared via
npm update(in-range patches) plus targetedoverrides:tar^7.5.22sqlite3 → node-gypchain (no 6.x fix exists)brace-expansion^5.0.8@tootallnate/once2.0.1@typescript-eslint/typescript-estree→minimatch9.0.7npm updateAll production and non-bundled dev advisories are cleared.
type-check,lint,build, and the full test suite (39/39) remain green.Six documented-ignored advisories (
ci:— maintainer decision, 2026-07-26)Six findings could not be remediated because they live inside npm's frozen
bundledDependencies, reached solely through the release-time devDependency@semantic-release/npm → npm. Bundled deps are pinned at npm's own publish time and cannot be changed bynpm updateoroverridesfrom this repo. (Forcing a newernpmbundle was tested and rejected: it still trails these advisories and requires Node ≥22, breaking the Node 16/18/20testmatrix.)Per maintainer decision, these are ignored in
osv-scanner.toml, scoped to the exact 13 advisory IDs on these six release-only packages — no blanket dev/ecosystem/severity ignore. Each entry carries a written justification (dev/release-only, not in the shipped runtime or build/test path, unfixable from this repo).tarbrace-expansionpicomatchsigstore@sigstore/coreip-addressGate remains real: verified locally that OSV-Scanner now passes on this repo (exit 0) and still fails (exit 1) on a hypothetical unrelated high (e.g.
lodash@4.17.11) — the narrow ID scoping means any new or different advisory, runtime or dev, still blocks the job.Files changed
.github/workflows/ci.yml— audit → OSV-Scannerpackage.json/package-lock.json— dependency bumps + overridesosv-scanner.toml— narrowly-scoped ignore of the 6 bundled-npm advisories