fix(allowScripts): close enforcement gaps (#9652) (backport release/v11)#9663
Merged
Merged
Conversation
Backport of npm#9652 to release/v11. Two v11 adaptations versus latest: - link.js: dropped the patchRelaxOpts/cli-only-flag lines (that helper only exists on latest); the preflight and global-install policy gating are kept. - Omitted the bundled-dependency regression test. v11's rebuild gate is deny-only (blocks on isScriptAllowed === false), so a bundled dep (null verdict) is not blocked there and the test would not hold. (cherry picked from commit 60d0d3d)
owlstronaut
approved these changes
Jun 25, 2026
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.
Backport of #9652 to
release/v11.Two adaptations versus latest:
link.js: dropped thepatchRelaxOpts/cli-only-flaglines, which only exist on latest. The global-install policy gating and strict preflight are kept.isScriptAllowed === false), so a bundled dep (null verdict) is not blocked there and the test would not hold.The version-pinned deny fix and the
npm linkglobal-install gating both apply and are tested. Changed source keeps 100% coverage onscript-allowed.js.