Skip to content

permission: keep parent allowlist when Worker execArgv is empty - #65359

Open
yunshingng wants to merge 2 commits into
nodejs:mainfrom
yunshingng:permission-worker-execargv-inherit
Open

permission: keep parent allowlist when Worker execArgv is empty#65359
yunshingng wants to merge 2 commits into
nodejs:mainfrom
yunshingng:permission-worker-execargv-inherit

Conversation

@yunshingng

@yunshingng yunshingng commented Aug 17, 2026

Copy link
Copy Markdown

Description

Under --permission, creating a Worker with execArgv: [] could drop the parent's filesystem allowlist compared to a default Worker.

This change re-attaches parent Permission Model flags when execArgv is provided explicitly (including an empty array).

Test plan

  • test/parallel/test-permission-worker-empty-execargv.js
  • CI

cc @RafaelGSS

When execArgv is set explicitly (including []), workers no longer inherit
the parent's CLI flags. Re-attach Permission Model flags from the parent
so empty/modified execArgv does not drop filesystem allowlists.

Signed-off-by: yunshingng <yunshingng25@gmail.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/security-wg

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. worker Issues and PRs related to Worker support. labels Aug 17, 2026
- Use only primordials in ensurePermissionFlagsInExecArgv
- Improve flag presence checks for --flag and --flag=value forms
- Align regression test with parallel test style (common, isMainThread)

Signed-off-by: yunshingng <yunshingng25@gmail.com>
@RafaelGSS RafaelGSS added the permission Issues and PRs related to the Permission Model label Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. permission Issues and PRs related to the Permission Model worker Issues and PRs related to Worker support.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants