From bf59539b980cbada964bf4c0991afe55668526e8 Mon Sep 17 00:00:00 2001 From: RafaelGSS Date: Tue, 27 Aug 2024 18:00:12 -0300 Subject: [PATCH] src,loader,permission: throw on InternalWorker use Previously this PR it was expected that InternalWorker usage doesn't require the --allow-worker when the permission model is enabled. This, however, exposes a vulnerability whenever the instance gets accessed by the user. For example through diagnostics_channel.subscribe('worker_threads') PR-URL: https://github.com/nodejs-private/node-private/pull/629 Refs: https://hackerone.com/reports/2575105 Reviewed-By: Matteo Collina Reviewed-By: Robert Nagy CVE-ID: CVE-2025-23083 --- doc/api/cli.md | 2 + src/node_worker.cc | 6 +-- test/es-module/test-esm-loader-hooks.mjs | 8 ++-- .../test-permission-dc-worker-threads.js | 19 +++++++++ test/parallel/test-runner-module-mocking.js | 41 +++++++++++++++++++ 5 files changed, 68 insertions(+), 8 deletions(-) create mode 100644 test/parallel/test-permission-dc-worker-threads.js diff --git a/doc/api/cli.md b/doc/api/cli.md index dd058306aa2..e48340024e8 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -1061,6 +1061,8 @@ added: Enable module mocking in the test runner. +This feature requires `--allow-worker` if used with the [Permission Model][]. + ### `--experimental-transform-types`