Skip to content

Commit 109c817

Browse files
authored
doc: deprecate passing args to spawn and execFile
PR-URL: nodejs#57389 Refs: nodejs#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 fe5817e commit 109c817

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

doc/api/deprecations.md

+17
Original file line numberDiff line numberDiff line change
@@ -3855,6 +3855,21 @@ Type: Documentation-only
38553855
`process.features.tls_alpn`, `process.features.tls_ocsp`, and `process.features.tls_sni` are
38563856
deprecated, as their values are guaranteed to be identical to that of `process.features.tls`.
38573857

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

0 commit comments

Comments
 (0)