Skip to content

Commit d6cd466

Browse files
committed
src: whitelist new options for NODE_OPTIONS
Add --inspect-*, --napi-modules, --trace-event-categories Remove --prof-process, like -p and -e, it causes node to do something other than run node js scripts. 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 6342988 commit d6cd466

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

doc/api/cli.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -411,14 +411,18 @@ Node options that are allowed are:
411411
- `--enable-fips`
412412
- `--force-fips`
413413
- `--icu-data-dir`
414+
- `--inspect-brk`
415+
- `--inspect-port`
416+
- `--inspect`
417+
- `--napi-modules`
414418
- `--no-deprecation`
415419
- `--no-warnings`
416420
- `--openssl-config`
417-
- `--prof-process`
418421
- `--redirect-warnings`
419422
- `--require`, `-r`
420423
- `--throw-deprecation`
421424
- `--trace-deprecation`
425+
- `--trace-events-categories`
422426
- `--trace-events-enabled`
423427
- `--trace-sync-io`
424428
- `--trace-warnings`

src/node.cc

+9-5
Original file line numberDiff line numberDiff line change
@@ -3703,25 +3703,29 @@ static void CheckIfAllowedInEnv(const char* exe, bool is_env,
37033703

37043704
static const char* whitelist[] = {
37053705
// Node options
3706-
"-r", "--require",
3706+
"--require", "-r",
3707+
"--inspect",
3708+
"--inspect-brk",
3709+
"--inspect-port",
37073710
"--no-deprecation",
3711+
"--trace-deprecation",
3712+
"--throw-deprecation",
37083713
"--no-warnings",
3714+
"--napi-modules",
37093715
"--trace-warnings",
37103716
"--redirect-warnings",
3711-
"--trace-deprecation",
37123717
"--trace-sync-io",
37133718
"--trace-events-enabled",
3719+
"--trace-events-categories",
37143720
"--track-heap-objects",
3715-
"--throw-deprecation",
37163721
"--zero-fill-buffers",
37173722
"--v8-pool-size",
3718-
"--use-openssl-ca",
37193723
"--use-bundled-ca",
3724+
"--use-openssl-ca",
37203725
"--enable-fips",
37213726
"--force-fips",
37223727
"--openssl-config",
37233728
"--icu-data-dir",
3724-
"--napi-modules",
37253729

37263730
// V8 options
37273731
"--max_old_space_size",

0 commit comments

Comments
 (0)