Skip to content

Commit 4fdd2e3

Browse files
aduh95RafaelGSS
authored andcommitted
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 5965a4c commit 4fdd2e3

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
@@ -3852,6 +3852,21 @@ Type: Documentation-only
38523852
`process.features.tls_alpn`, `process.features.tls_ocsp`, and `process.features.tls_sni` are
38533853
deprecated, as their values are guaranteed to be identical to that of `process.features.tls`.
38543854

3855+
### DEP0190: Passing `args` to `node:child_process` `execFile`/`spawn` with `shell` option `true`
3856+
3857+
<!-- YAML
3858+
changes:
3859+
- version:
3860+
- REPLACEME
3861+
pr-url: https://github.com/nodejs/node/pull/57389
3862+
description: Documentation-only deprecation.
3863+
-->
3864+
3865+
Type: Documentation-only
3866+
3867+
When an `args` array is passed to [`child_process.execFile`][] or [`child_process.spawn`][] with the option
3868+
`{ shell: true }`, the values are not escaped, only space-separated, which can lead to shell injection.
3869+
38553870
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
38563871
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3
38573872
[RFC 8247 Section 2.4]: https://www.rfc-editor.org/rfc/rfc8247#section-2.4
@@ -3879,6 +3894,8 @@ deprecated, as their values are guaranteed to be identical to that of `process.f
38793894
[`assert`]: assert.md
38803895
[`asyncResource.runInAsyncScope()`]: async_context.md#asyncresourceruninasyncscopefn-thisarg-args
38813896
[`buffer.subarray`]: buffer.md#bufsubarraystart-end
3897+
[`child_process.execFile`]: child_process.md#child_processexecfilefile-args-options-callback
3898+
[`child_process.spawn`]: child_process.md#child_processspawncommand-args-options
38823899
[`child_process`]: child_process.md
38833900
[`clearInterval()`]: timers.md#clearintervaltimeout
38843901
[`clearTimeout()`]: timers.md#cleartimeouttimeout

0 commit comments

Comments
 (0)