Skip to content

fix(audit): query the npm bulk advisory endpoint directly - #32

Open
littledino2112 wants to merge 1 commit into
mainfrom
hn/audit-bulk-advisory-endpoint
Open

fix(audit): query the npm bulk advisory endpoint directly#32
littledino2112 wants to merge 1 commit into
mainfrom
hn/audit-bulk-advisory-endpoint

Conversation

@littledino2112

Copy link
Copy Markdown
Contributor

npmjs retired the legacy audit endpoints on 2026-07-15 (410 Gone), which kills yarn audit permanently (Yarn v1 is frozen) and pnpm audit before pnpm 11. Worse, nodejs-audit.sh has been passing vacuously since then: the audit command exits 1 on the 410, and the exit-code bitmask check reads that as "no findings".

The new audit-advisories.js (node stdlib, no dependencies) reads the package set straight from the lockfile — pnpm-lock.yaml v6 and v9, and yarn.lock v1 are all supported — and POSTs it to the documented replacement endpoint, the same request shape pnpm 11 itself sends (pnpm#11268). Same severity threshold semantics; registry unavailability still passes the gate (parity with the old behavior). The Concourse task and the synced GitHub action both delegate to it — the action no longer needs pnpm or an install step. Mirrors the buck2-side fix in blinkbitcoin/blink#685.

Rollout warning — expect red gates, and that's the point: real findings accrued while audits were vacuous. Tested against current lockfiles at high: blink 78 findings, price 52 + one critical (@babel/traverse RCE, GHSA-67hx-6x53-jw92, vulnerable since 2023), blink-terminal 26. Repos re-syncing this at the default level=high will fail until triaged — instantiating nodejs_audit(level="critical") during triage is the escape valve. Consumers using the synced action need ci/vendor/tasks/ in their vendir config (blink-kyc, blink-terminal, blink-fiat, admin-panel already have it).

npmjs.org retired the legacy audit endpoints on 2026-07-15 (410 Gone),
breaking 'yarn audit' permanently (Yarn v1 is frozen) and 'pnpm audit'
for every release before pnpm 11. Since then nodejs-audit has passed
vacuously: the audit command exits 1 on the 410, which the exit-code
bitmask check reads as no findings.

audit-advisories.js reads the package set straight from the lockfile
(pnpm-lock.yaml v6/v9 or yarn.lock v1) and posts it to the documented
replacement endpoint /-/npm/v1/security/advisories/bulk - the same
request pnpm 11 sends - applying the same severity threshold. The
Concourse task and the synced GitHub action both delegate to it; the
action no longer needs pnpm or an install step.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant