Skip to content

DEP0190 (passing args to spawn with shell: true) isn't fixable when stdio option is required #58763

Description

@Knagis

Version

24.1.0

Platform

Any

Subsystem

child_process

What steps will reproduce the bug?

child_process.spawn("command", ["arg1", "arg2"], { shell: true, stdio: ["ignore", "pipe", "pipe"] })

running this on node v24 will show DEP0190

When an args array is passed to child_process.execFile or child_process.spawn with the option { shell: true }, the values are not escaped, only space-separated, which can lead to shell injection.

However, there does not seem to be any alternative to fix this warning - since exec doesn't support custom stdio option.

How often does it reproduce? Is there a required condition?

What is the expected behavior? Why is that the expected behavior?

The warning is correct, however has to be a way for the developer to fix it which doesn't seem to be the case with the current child_process APIs.

What do you see instead?

Unfixable deprecation warning.

Additional information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    child_processIssues and PRs related to the child_process subsystem.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions