Skip to content

Commit d1fcb54

Browse files
committed
doc: deprecate passing args to spawn and execFile
PR-URL: #57389 Refs: #57199 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jason Zhang <[email protected]> Reviewed-By: Ulises Gascón <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 3e96aa8 commit d1fcb54

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

doc/api/deprecations.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3734,6 +3734,21 @@ Type: Documentation-only
37343734
`process.features.tls_alpn`, `process.features.tls_ocsp`, and `process.features.tls_sni` are
37353735
deprecated, as their values are guaranteed to be identical to that of `process.features.tls`.
37363736

3737+
### DEP0190: Passing `args` to `node:child_process` `execFile`/`spawn` with `shell` option `true`
3738+
3739+
<!-- YAML
3740+
changes:
3741+
- version:
3742+
- REPLACEME
3743+
pr-url: https://github.com/nodejs/node/pull/57389
3744+
description: Documentation-only deprecation.
3745+
-->
3746+
3747+
Type: Documentation-only
3748+
3749+
When an `args` array is passed to [`child_process.execFile`][] or [`child_process.spawn`][] with the option
3750+
`{ shell: true }`, the values are not escaped, only space-separated, which can lead to shell injection.
3751+
37373752
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
37383753
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3
37393754
[RFC 8247 Section 2.4]: https://www.rfc-editor.org/rfc/rfc8247#section-2.4
@@ -3762,6 +3777,8 @@ deprecated, as their values are guaranteed to be identical to that of `process.f
37623777
[`assert`]: assert.md
37633778
[`asyncResource.runInAsyncScope()`]: async_context.md#asyncresourceruninasyncscopefn-thisarg-args
37643779
[`buffer.subarray`]: buffer.md#bufsubarraystart-end
3780+
[`child_process.execFile`]: child_process.md#child_processexecfilefile-args-options-callback
3781+
[`child_process.spawn`]: child_process.md#child_processspawncommand-args-options
37653782
[`child_process`]: child_process.md
37663783
[`clearInterval()`]: timers.md#clearintervaltimeout
37673784
[`clearTimeout()`]: timers.md#cleartimeouttimeout

0 commit comments

Comments
 (0)