Skip to content

[Node.js v24] DEP0190 DeprecationWarning: spawn with shell:true + args array on gateway startup #62881

@Stache73

Description

@Stache73

Summary

On Node.js v24, the gateway emits the following deprecation warning on startup:

(node:XXXXX) [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.

This appears to be triggered by a child_process.spawn() call in OpenClaw's codebase where both a separate args array and { shell: true } are passed together. Node.js v24 introduced DEP0190 to flag this pattern because the args are concatenated without shell-escaping, which can allow shell injection if any argument contains user-controlled input.

Steps to reproduce

  1. Run OpenClaw gateway on Node.js v24+
  2. Check the gateway log or console output after startup
  3. Observe: [DEP0190] DeprecationWarning: Passing args to a child process with shell option true...

Expected behaviour

No DEP0190 warning. Child processes should either:

  • Use shell: false with a properly constructed args array (preferred), or
  • Use shell: true without a separate args array (pass a single command string)

Actual behaviour

DEP0190 warning emitted on every gateway start on Node.js v24+. Not breaking — gateway functions normally — but indicates a latent shell injection risk and will become noisier as Node.js deprecation tracking tightens.

Environment

  • OpenClaw: v2026.4.5
  • Node.js: v24.6.0
  • OS: Windows 10 x64 (build 19045)

Additional context

The full deprecation trace can be obtained by running the gateway with --trace-deprecation:

node --trace-deprecation C:\...\openclaw\dist\index.js gateway

This would identify the exact line in the source where the spawn call with { shell: true, args: [...] } occurs.

The fix is straightforward: locate all spawn/execFile calls using { shell: true } with a separate args array and either switch to shell: false or restructure to pass a single command string. This also removes the theoretical shell injection surface if any of those arguments ever incorporate external input.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions