DEP0190: spawnServer passes args array with shell:true, triggering Node v26 deprecation warning

Open Beginner friendly
#203 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
node.js, typescript
Domain
cli, tooling

Research direction

Start in packages/run/src/adapter/index.ts at the spawnServer function and compare the distributed packages/run/dist/adapter/index.js. Check how the command and args are passed when shell is enabled, then verify that npm run preview no longer emits DEP0190 on Node.js v26 while still starting successfully.

Written by the indexing model from the issue text.

Description

Bug

Running npm run preview (i.e. marko-run preview) logs the following deprecation warning on Node.js v26:

(node:24456) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated.

Root cause

In packages/run/src/adapter/index.ts (distributed as dist/adapter/index.js), the spawnServer function calls:

cp.spawn(cmd, args, {
  shell: true,
  ...
});

Node.js v26 introduced DEP0190 which warns when a separate args array is passed alongside shell: true, because the args are concatenated (not escaped) before being handed to the shell, which can be a security risk.

Fix

Either:

  1. Merge cmd + args into a single string when using shell: true:

    cp.spawn([cmd, ...args].join(" "), [], { shell: true, ... });
    
  2. Drop shell: true if it is only needed for Windows .cmd/.bat resolution, and use { shell: process.platform === "win32" } — but then also merge args into the command string on that path.

Environment

  • @marko/run: 0.11.0
  • Node.js: v26.2.0
  • OS: macOS Darwin 25.5.0
Dominant language
TypeScript
Stars
175
Forks
17
Avg merge
5h 26m
Merged PRs (30d)
5

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from marko-js/run

All issues in marko-js/run

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.