Skip to content

Commit 12b66e6

Browse files
sam-githubMylesBorins
authored andcommitted
src: whitelist new options for NODE_OPTIONS
Add --debug-*, --napi-modules Remove --prof-process, like -p and -e, it causes node to do something other than run node js scripts. Backport-PR-URL: #12677 PR-URL: #13002 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent dd6ea89 commit 12b66e6

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

doc/api/cli.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -346,15 +346,17 @@ Node options that are allowed are:
346346
- `--enable-fips`
347347
- `--force-fips`
348348
- `--icu-data-dir`
349+
- `--debug-brk`
350+
- `--debug-port`
351+
- `--debug`
352+
- `--napi-modules`
349353
- `--no-deprecation`
350354
- `--no-warnings`
351355
- `--openssl-config`
352-
- `--prof-process`
353356
- `--redirect-warnings`
354357
- `--require`, `-r`
355358
- `--throw-deprecation`
356359
- `--trace-deprecation`
357-
- `--trace-events-enabled`
358360
- `--trace-sync-io`
359361
- `--trace-warnings`
360362
- `--track-heap-objects`

src/node.cc

+8-4
Original file line numberDiff line numberDiff line change
@@ -3787,19 +3787,23 @@ static void CheckIfAllowedInEnv(const char* exe, bool is_env,
37873787

37883788
static const char* whitelist[] = {
37893789
// Node options
3790-
"-r", "--require",
3790+
"--require", "-r",
3791+
"--debug",
3792+
"--debug-brk",
3793+
"--debug-port",
37913794
"--no-deprecation",
3795+
"--trace-deprecation",
3796+
"--throw-deprecation",
37923797
"--no-warnings",
3798+
"--napi-modules",
37933799
"--trace-warnings",
37943800
"--redirect-warnings",
3795-
"--trace-deprecation",
37963801
"--trace-sync-io",
37973802
"--track-heap-objects",
3798-
"--throw-deprecation",
37993803
"--zero-fill-buffers",
38003804
"--v8-pool-size",
3801-
"--use-openssl-ca",
38023805
"--use-bundled-ca",
3806+
"--use-openssl-ca",
38033807
"--enable-fips",
38043808
"--force-fips",
38053809
"--openssl-config",

0 commit comments

Comments
 (0)