fix: validate registry path for allow-remote tarball exception#9473
Merged
owlstronaut merged 1 commit intoJun 4, 2026
Merged
Conversation
da88828 to
25dd453
Compare
Contributor
Author
|
Opened companion issue #9474 to track the path-qualified registry boundary behavior. This PR is the proposed fix for that issue. |
25dd453 to
1b25357
Compare
Contributor
Author
|
Pushed a follow-up in 1b25357 to cover the Arborist registry-path allow-remote cases and simplify the registry path normalization branch. The previous Arborist CI failure was coverage on reify.js; locally the focused reify coverage is now 100%, and the new GitHub workflow runs are currently waiting on action_required approval for the forked PR. |
Contributor
Author
|
CI is green now. @owlstronaut, it would be kind of you to review this when you have cycles. |
owlstronaut
approved these changes
Jun 4, 2026
Contributor
|
🎉 Backport to |
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
Tighten the registry-mediated tarball exception used when extracting registry dependencies under
allow-remote.Previously Arborist treated a resolved tarball as registry-mediated when its hostname matched the selected registry hostname. That allowed same-host sibling paths to bypass
allow-remote=nonefor path-qualified registries, for example:https://registry.example.com/npm/https://registry.example.com/evil/pkg-1.0.0.tgzThis change requires the resolved tarball URL to match the registry origin and remain under the selected registry path before overriding pacote's
allowRemotehandling.This is a tightening of the registry tarball exception introduced around #9348, and is related to the
allow-remote=nonebehavior discussed in #9347, but covers the path-qualified registry case.For root-scoped registries, origin match remains sufficient because there is no registry path boundary to enforce.
Testing
node node_modules/tap/bin/run.js test/lib/commands/ci.js --no-coveragenode node_modules/tap/bin/run.js test/lib/commands/install.js --no-coverage