Skip to content

Conversation

@MikeMcQuaid
Copy link
Member

This emulates what pnpm 10+ does by default.

In response to current NPM supply-side attacks.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances security for NPM installations by adding an ignore_scripts parameter (defaulting to true) to std_npm_args and related functions. This change aligns with pnpm 10+ behavior and mitigates NPM supply-side attacks by preventing automatic execution of install scripts unless explicitly allowed.

  • Added ignore_scripts parameter with true default to std_npm_args, std_npm_install_args, and local_npm_install_args
  • Updated function signatures and type annotations to support the new parameter
  • Modified implementation to conditionally append --ignore-scripts flag based on parameter value

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
Library/Homebrew/utils.rb Contains an unintended comment modification (likely accidental edit)
Library/Homebrew/language/node.rb Adds ignore_scripts parameter to std_npm_install_args and local_npm_install_args, appends --ignore-scripts flag when enabled
Library/Homebrew/formula.rb Adds ignore_scripts parameter to public std_npm_args API and forwards it to underlying Node language functions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MikeMcQuaid MikeMcQuaid force-pushed the std_npm_args_ignore_scripts branch from 5a46a18 to f73f11d Compare November 27, 2025 11:04
Copy link
Member

@bevanjkay bevanjkay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me, I think if we were to add pnpm as an option/default separating the code in the language class would be more suitable and maintainable anyway.

Copy link
Member

@p-linnane p-linnane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better than a full cutover to pnpm. Thanks!

Copilot AI review requested due to automatic review settings November 27, 2025 19:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

This emulates what `pnpm` 10+ does by default.

In response to current NPM supply-side attacks.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@MikeMcQuaid MikeMcQuaid force-pushed the std_npm_args_ignore_scripts branch from 355b34a to bc7621c Compare November 27, 2025 19:25
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Nov 27, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 27, 2025
@botantony botantony added this pull request to the merge queue Nov 27, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 27, 2025
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Nov 27, 2025
@p-linnane p-linnane removed this pull request from the merge queue due to a manual request Nov 27, 2025
@p-linnane p-linnane added this pull request to the merge queue Nov 27, 2025
Merged via the queue into main with commit f2613fe Nov 27, 2025
35 checks passed
@p-linnane p-linnane deleted the std_npm_args_ignore_scripts branch November 27, 2025 22:10
botantony added a commit to Homebrew/homebrew-core that referenced this pull request Nov 27, 2025
As `std_npm_args` now ignores scripts by default
(Homebrew/brew#21136), let's start accepting
NodeJS formula updates

Signed-off-by: botantony <antonsm21@gmail.com>
chenrui333 referenced this pull request in Homebrew/homebrew-core Dec 4, 2025
appwrite: remove universal binaries

Co-authored-by: Patrick Linnane <patrick@linnane.io>
Signed-off-by: botantony <antonsm21@gmail.com>
chenrui333 referenced this pull request in Homebrew/homebrew-core Dec 4, 2025
chenrui333 referenced this pull request in Homebrew/homebrew-core Dec 4, 2025
chenrui333 referenced this pull request in Homebrew/homebrew-core Dec 4, 2025
chenrui333 referenced this pull request in Homebrew/homebrew-core Dec 4, 2025
hf-mcp-server: sleep longer

Signed-off-by: Rui Chen <rui@chenrui.dev>
daeho-ro referenced this pull request in Homebrew/homebrew-core Dec 4, 2025
daeho-ro referenced this pull request in Homebrew/homebrew-core Dec 4, 2025
daeho-ro referenced this pull request in Homebrew/homebrew-core Dec 4, 2025
daeho-ro referenced this pull request in Homebrew/homebrew-core Dec 4, 2025
daeho-ro referenced this pull request in Homebrew/homebrew-core Dec 4, 2025
@chenrui333
Copy link
Member

now, all the fsevent.node stuff is coming back with this change

@MikeMcQuaid
Copy link
Member Author

@chenrui333 Can you elaborate on that and open some relevant issue(s)?

@chenrui333
Copy link
Member

I will have to compile later this weekend and see what exactly going on across the board.

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.

6 participants