Skip to content

fix: escape executable name in libnpmexec run-script#9467

Merged
owlstronaut merged 1 commit into
release/v11from
backport/v11/9436
Jun 2, 2026
Merged

fix: escape executable name in libnpmexec run-script#9467
owlstronaut merged 1 commit into
release/v11from
backport/v11/9436

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented Jun 2, 2026

Backport of #9436 to release/v11.

run() in libnpmexec wraps the executable name in double quotes before it
becomes the npx script string, but double quotes still expand $(),
backticks, $var and a closing quote, so a package whose bin key holds
shell metacharacters breaks out once the name reaches sh -c. The bin
name comes straight from a published package.json. Switch the
non-Windows branch to single-quote escaping so the name is taken
literally.

(cherry picked from commit 6901bb1)
@owlstronaut owlstronaut merged commit 1bb1b8c into release/v11 Jun 2, 2026
35 checks passed
@owlstronaut owlstronaut deleted the backport/v11/9436 branch June 2, 2026 18:33
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.

2 participants