Skip to content

Potential fix for code scanning alert no. 11: Shell command built from environment values#54

Closed
NovasPlace wants to merge 1 commit into
masterfrom
alert-autofix-11
Closed

Potential fix for code scanning alert no. 11: Shell command built from environment values#54
NovasPlace wants to merge 1 commit into
masterfrom
alert-autofix-11

Conversation

@NovasPlace

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/NovasPlace/CSM/security/code-scanning/11

The best fix is to stop invoking cmd.exe /c with a constructed command string and instead execute npm directly with argument-array passing on all platforms. This avoids shell interpretation and removes the injection/misparsing class completely while preserving behavior.

In scripts/release-package-stage.mjs, update the execution block around lines 64–70:

  • Remove Windows-specific shell command assembly (ComSpec, cmd /c, quoteWindowsArg usage).
  • Call spawnSync with a fixed executable (npm) and packArgs directly.
  • Keep existing cwd, env, timeout, and output handling unchanged.

Also remove the now-unused helper quoteWindowsArg to keep the file clean and avoid dead code.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…m environment values

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@NovasPlace NovasPlace closed this Jul 20, 2026
@NovasPlace
NovasPlace deleted the alert-autofix-11 branch July 20, 2026 07:08
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.

1 participant