Skip to content

fix: avoid shell execution for npm installs#24

Draft
gh-xj wants to merge 1 commit intomuqsitnawaz:mainfrom
gh-xj:fix/npm-install-argv
Draft

fix: avoid shell execution for npm installs#24
gh-xj wants to merge 1 commit intomuqsitnawaz:mainfrom
gh-xj:fix/npm-install-argv

Conversation

@gh-xj
Copy link
Copy Markdown

@gh-xj gh-xj commented Apr 28, 2026

Summary

Closes #23.

  • validate managed CLI version specifiers before using them in install paths or npm package specs
  • run npm view and npm install via execFile argument arrays instead of shell command strings
  • add focused tests for unsafe version rejection and argv-based npm invocation

Verification

  • bun run vitest run tests/versions.test.ts
  • bun x tsc --noEmit
  • bun run build

Full bun run test still fails locally with unrelated existing failures in:

  • tests/permissions.test.ts
  • tests/sandbox.test.ts
  • src/lib/__tests__/git-sync.test.ts

Notes

Opened as a draft because this touches a security-sensitive command execution path. I kept the public issue high-level and can adjust disclosure/details to maintainer preference.

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.

Harden managed npm install path against unsafe version specs

1 participant