Skip to content

fix: resolve the shell from a trusted PATH - #163

Open
JamieMagee wants to merge 5 commits into
npm:mainfrom
JamieMagee:fix/shell-trusted-path
Open

JamieMagee wants to merge 5 commits into
npm:mainfrom
JamieMagee:fix/shell-trusted-path

Conversation

@JamieMagee

Copy link
Copy Markdown

spawnWithShell passed the bare shell name to spawn, which resolves it against opts.env.PATH, so a caller that leads that PATH with an untrusted node_modules/.bin let a dependency's sh/cmd bin shadow the shell. Resolve the shell from the ambient process.env.PATH instead, with a fallback to the bare name.

@JamieMagee
JamieMagee requested a review from a team as a code owner July 2, 2026 20:56
shmam
shmam previously approved these changes Jul 16, 2026
Comment thread lib/index.js Outdated
Comment thread lib/index.js Outdated
Comment thread lib/index.js Outdated
martinrrm
martinrrm previously approved these changes Jul 20, 2026
martinrrm
martinrrm previously approved these changes Jul 20, 2026
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.

3 participants