fix(npm): validate lockfile tarball origins - #36430
Open
nathanwhit wants to merge 3 commits into
Open
Conversation
nathanwhit
force-pushed
the
fix/npm-lockfile-tarball-origin
branch
from
August 18, 2026 00:35
fbe7c9a to
12ad894
Compare
nathanwhit
force-pushed
the
fix/npm-lockfile-tarball-origin
branch
from
August 25, 2026 01:08
12ad894 to
8036e6b
Compare
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
Details
Resolution snapshot creation now parses explicit lockfile tarball URLs before accepting them. The comparison uses normalized URL origins and accepts either the configured registry or the standard npm registry origin that Deno relocates according to npm configuration. Malformed URLs and unrelated origins are reported as lockfile errors.
The
audit --ignore-registry-errorsfixture now keeps the generated lockfile and configured registry on the same trusted test origin, while a nonexistent registry path still exercises the audit API error-handling boundary.Validation
cargo build -p denocargo build -p test_servertarget/debug/deno fmt --check tests/specs/audit/ignore_registry_errors/__test__.jsonccargo fmt --check --package deno_npmcargo test -p deno_npm test_snapshot_from_lockfile -- --nocapturecargo test -p deno_npm_installer initializer::tests -- --nocapturecargo test -p specs_tests --test specs -- specs::audit::ignore_registry_errors --exact --nocapturecargo test -p specs_tests --test specs -- specs::npm::tarball_relocate_to_registry::relocates_tarball_to_configured_registry --exact --nocapturecargo check -p deno_npm -p deno_npm_installer --all-targetscargo clippy -p deno_npm --all-targets -- -D warnings