Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] npx executing runsv cli #8172

Closed
2 tasks done
pandasoli opened this issue Mar 20, 2025 · 2 comments
Closed
2 tasks done

[BUG] npx executing runsv cli #8172

pandasoli opened this issue Mar 20, 2025 · 2 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps

Comments

@pandasoli
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

Running npx sv create my-app runs /usr/bin/sv which is runit (service-manager)'s cli interface.

Expected Behavior

I expected to download and run the sveltekit cli (https://npmjs.com/package/sv).

Steps To Reproduce

  1. On KISS linux (https://kisslinux.github.io) - But might also work on any other system with runit
  2. Run npx sv create my-app
  3. See a non-expected answer like:
fail: my-app: can't change to service directory: No such file or directory

Which is the result of running sv create my-app manually.

Environment

  • npm: 11.2.0
  • Node.js: v23.9.0
  • OS Name: KISS
  • System Model Name: PC
  • npm config:
; node bin location = /usr/bin/node
; node version = v23.9.0
; npm local prefix = /home/eli
; npm version = 11.2.0
; cwd = /home/eli
; HOME = /home/eli
; Run `npm config ls -l` to show all defaults.
@pandasoli pandasoli added Bug thing that needs fixing Needs Triage needs review for next steps labels Mar 20, 2025
@pandasoli
Copy link
Author

pandasoli commented Mar 20, 2025

Maybe this could be fixed by looking for executable files only in the path where npm installs them and when it comes to /usr/bin only allow execution of files installed by npm.

This would avoid execution of any executable file, which might also be a security issue. npx ls runs /usr/bin/ls, so it might also be able to run programs the user would not have permission to.

@milaninfy
Copy link
Contributor

Closing this as duplicate/similer of #8190

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps
Projects
None yet
Development

No branches or pull requests

2 participants