Skip to content

W-23795493-resolve npm from PATH only, not CWD - #902

Merged
WillieRuemmele merged 2 commits into
mainfrom
sl/W-23795493
Aug 13, 2026
Merged

W-23795493-resolve npm from PATH only, not CWD#902
WillieRuemmele merged 2 commits into
mainfrom
sl/W-23795493

Conversation

@soridalac

Copy link
Copy Markdown
Contributor

Summary

  • Reject any npm binary resolved from the current working directory
  • On Windows, both execFile (via CreateProcess) and the which module resolve executables from CWD before PATH, bypassing the previous execexecFile fix
  • Use which to resolve npm, then verify the resolved path is not inside CWD before executing
  • When resolved path is a .cmd/.bat file, pass { shell: true } with the absolute path so Windows can execute it

Test plan

  • Windows VM: npm.exe (copy of calc.exe) in CWD → calc no longer opens
  • Windows VM: normal directory → sf version --verbose works with publish dates
  • macOS: linked plugin → sf version --verbose works normally
  • Unit tests pass

@W-23795493@

@WillieRuemmele

Copy link
Copy Markdown
Contributor

QA Notes


✅ : verified

plugin-version.mov

@WillieRuemmele
WillieRuemmele merged commit 89a65de into main Aug 13, 2026
9 checks passed
@WillieRuemmele
WillieRuemmele deleted the sl/W-23795493 branch August 13, 2026 16:57
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