fix(ext/node): validate execArgv flags in worker_threads instead of rejecting all#32145
Merged
bartlomieju merged 1 commit intodenoland:mainfrom Feb 13, 2026
Merged
Conversation
… rejecting all Previously, creating a `Worker` with any non-empty `execArgv` array threw `ERR_WORKER_INVALID_EXEC_ARGV`. This change validates each flag against `process.allowedNodeEnvironmentFlags` and a set of worker-disallowed per-process flags, accepting valid flags like `--trace-warnings`. - Pass `execArgv` through worker metadata so `process.execArgv` is set correctly inside the worker - Set `process.traceProcessWarnings` when `--trace-warnings` is present - Add `worker.stderr` forwarding via internal messages so the parent can read the worker's stderr output - Apply the same validation logic to `NODE_OPTIONS` env variable Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0216821 to
752a9f1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
execArgvflags againstprocess.allowedNodeEnvironmentFlagsanda set of worker-disallowed per-process flags, instead of rejecting all
non-empty
execArgvarraysexecArgvthrough worker metadata soprocess.execArgvis setcorrectly inside the worker
process.traceProcessWarningswhen--trace-warningsis present inexecArgvworker.stderrforwarding from worker to parent via internal messagesNODE_OPTIONSenv variableCloses the gap for
test-worker-execargv.jswhile keepingtest-worker-execargv-invalid.jspassing.Test plan
cargo test --test node_compat parallel -- --filter test-worker-execargv.jspassescargo test --test node_compat parallel -- --filter test-worker-execargv-invalid.jsstill passes🤖 Generated with Claude Code