Skip to content

fix: improve integrity verification errors - #914

Closed
Aschenbath wants to merge 1 commit into
nodejs:mainfrom
Aschenbath:feat/integrity-errors-570
Closed

Aschenbath wants to merge 1 commit into
nodejs:mainfrom
Aschenbath:feat/integrity-errors-570

Conversation

@Aschenbath

Copy link
Copy Markdown

Custom registries with missing signing metadata can currently fail with low-level errors such as integrity.slice and an unhandled verification rejection. Await signature verification before caching an installation, clean up failed downloads, and report package-specific usage errors for missing/malformed metadata, untrusted keys, invalid key configuration, and signature failures.

Add an integrity guide linked from verification/hash errors and the README. It covers tampering risks, troubleshooting, the COREPACK_INTEGRITY_KEYS JSON format, and the empty-string opt-out. The existing 0 opt-out and pinned-hash checks remain supported. Latest-version failures retain the underlying reason and point to the guide instead of immediately recommending disabling verification.

Validation:

  • Full Vitest suite in replay mode on Node.js 24.20.0: 8 files passed; 208 tests passed and 1 existing expected failure (209 total).
  • TypeScript typecheck and ESLint (--max-warnings=0) passed.
  • Build passed.
  • Regressions cover unsigned/malformed registry metadata, invalid and untrusted keys, asynchronous package-root signature fallback, repeated rejection without caching/execution, and both supported opt-out values.

Closes #570

@aduh95

aduh95 commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

This account has opened more than 10 PRs in the last 24 hours. This looks like bot activity, and will result in a ban if the behavior continues.

@aduh95 aduh95 closed this Oct 20, 2026
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.

unhelpful error handling for integrity keys

2 participants