SharedWorker and AudioWorklet bypass --blockedUrlPattern/--allowedUrlPattern
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 8/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- javascript, typescript
Research direction
The bypass sits in how Puppeteer enforces the URL allow/block callbacks: build/src/third_party/index.js (#maybeSetupNetworkConditions, #attachToServiceWorkers) and the MCP side in src/utils/logger.ts and src/bin/chrome-devtools.ts. Reproduce with the PoC scripts described in the issue and a local server on 127.0.0.1:18999 and 19000. Done means shared-worker and audio-worklet loads are blocked under both flags, with tests, plus the status args redaction fix.
Written by the indexing model from the issue text.
Description
Version: 1.12.0 (npm), Chrome 156, Windows 11, bundled puppeteer-core 25.16.0.
Description
A page can bypass both network guardrail flags by issuing requests from a
SharedWorker. The page's own fetch and the same fetch from a dedicated
Worker are blocked; the identical fetch from a SharedWorker reaches the
blocked origin and returns its body.
The worker needs no server-side script: a blob worker created with
new SharedWorker(URL.createObjectURL(new Blob([...]))) is enough, so any page
that can run JavaScript is sufficient.
Impact: with --allowedUrlPattern, an allowed page can reach arbitrary
excluded origins, read CORS-enabled responses (including intranet/admin
endpoints) and trigger side effects; the same applies to blocked origins under
--blockedUrlPattern. Exfiltrated bodies can be posted back through the
MessagePort into the allowed page DOM, where the server returns them.
This is distinct from the service-worker bypass (#2990, fixed): the fix only
added service_worker handling. Shared workers are still unhandled on
puppeteer/main.
Reproduction
The PoCs are standalone (Node 24, Chrome 156; set PUPPETEER_BASE to a
directory where puppeteer resolves if it is not installed in the cwd).
poc-server.mjs starts 127.0.0.1:18999 (allowed) and 127.0.0.1:19000
(blocked) and always sends Access-Control-Allow-Origin: *.
node poc-server.mjs # terminal 1
node poc-shared-worker.mjs allowlist # terminal 2
node poc-shared-worker.mjs blocklist
The scripts pass the patterns directly to puppeteer.launch({allowlist}) /
({blocklist}), which is what the MCP server does with the CLI flags.
The same was reproduced end-to-end through the MCP server with
--allowedUrlPattern=http://127.0.0.1:18999/* (and with
--blockedUrlPattern=*://127.0.0.1:19000/*), navigating to the allowed page
and running the page script above.
Observed, both list types:
control fetch ERR:TypeError: Failed to fetch
dedicated worker ERR:TypeError: Failed to fetch
shared worker (bypass) OK:{"label":"blocked","path":"/ping"}
Also reproduced from https://example.com with --allowedUrlPattern=https://example.com/*:
the page and a blob dedicated worker cannot reach https://example.org, the
blob shared worker can.
Second vector: AudioWorklet
AudioWorklet.addModule() needs no user gesture and loads its module from the
audio service rather than the page's network context. The same allowlist /
blocklist is not applied, and the module executes (registerProcessor, then
new AudioWorkletNode(...) succeeds). This also works with
--no-javascript-evaluation, from page inline script only.
const ac = new AudioContext();
await ac.audioWorklet.addModule('http://127.0.0.1:19000/audioworklet.js');
const node = new AudioWorkletNode(ac, 'w');
node.port.onmessage = e => console.log(e.data); // worklet code ran
AudioWorkletGlobalScope has no fetch, so this vector gives code execution
from an excluded origin rather than body exfiltration.
Mechanism detail (page session): Network.setBlockedURLs does not block the
module load, Fetch interception does. For shared workers it is the opposite
(setBlockedURLs works, Fetch.enable on the worker session does not). Neither
single mechanism closes both.
Confirmed blocked neighbours: paint worklet, animation worklet, FontFace,
<audio>/<video>, fetch, workers, iframes, navigations.
Root cause
BlocklistCallback/AllowlistCallback are forwarded to Puppeteer, which
enforces them with Network.emulateNetworkConditionsByRule. That command is a
silent no-op on shared_worker sessions. Fetch.enable on the session is also
a no-op; Network.setBlockedURLs works. Audio worklet modules are loaded by the
audio service, outside the page's network context, and no worklet target exists
to attach, so the page-session rule never sees them either. See
build/src/third_party/index.js #attachToServiceWorkers (service workers
only) and #maybeSetupNetworkConditions.
Expectation
The same fetch inside a shared worker, and the audio worklet module load,
should fail, for both flags.
Fix options
- Puppeteer: send
Network.setBlockedURLson shared-worker sessions
(blocklist works today); enforce page sessions with Fetch interception
(required for audio worklets). Document the allowlist gap until a mechanism
or a Chrome fix exists. - MCP: bump Puppeteer; optionally add the page-session Fetch enforcement in
McpPage/McpContextand document both exceptions inpuppeteer-options.ts,
docs/configuration.mdandSECURITY.mdin the meantime.
Separate minor finding: status leaks daemon arguments
chrome-devtools status prints DaemonStatusResult.args unredacted:
args=["--viaCli","--ws-endpoint=ws://127.0.0.1:65535/devtools/browser/x?token=SECRET","--ws-headers={\"Authorization\":\"Bearer TOPSECRET\"}"]
redactDaemonArgsForLogging already exists in src/utils/logger.ts and is
applied by daemon/client.ts before the start log, but the daemon stores and
returns the raw mcpArgs and src/bin/chrome-devtools.ts prints
JSON.stringify(data.args). status is the documented health check, so
bearer tokens end up in pasted reports and CI logs. Redacting in the daemon
when building the status result (or applying the helper before printing) fixes
it.
- Dominant language
- TypeScript
- Stars
- 59.8k
- Forks
- 4.8k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 162
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ChromeDevTools/chrome-devtools-mcp
-
feature
Difficulty 1/5 Under an hour Newbie friendliness 78/100
ChromeDevTools/chrome-devtools-mcp#3689 ·
Maintainers usually reply within 1 day
-
`evaluate_script` `sourcePath` http(s) URLs are mangled into `file://` pathsMay be free again A pull request for this issue was closed without being merged. Opencollecting-feedback
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ChromeDevTools/chrome-devtools-mcp#3453 · 3 comments ·
Maintainers usually reply within 1 day
-
collecting-feedback feature
Difficulty 2/5 Half a day Newbie friendliness 76/100
ChromeDevTools/chrome-devtools-mcp#3225 · 3 comments ·
Maintainers usually reply within 1 day
-
confirmed p3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ChromeDevTools/chrome-devtools-mcp#2947 · 1 comment ·
Maintainers usually reply within 1 day
-
Project Migration: Moving to devtools-frontendPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 5/5 Over a week Newbie friendliness 1/100
ChromeDevTools/chrome-devtools-mcp#3648 ·
Maintainers usually reply within 1 day
All issues in ChromeDevTools/chrome-devtools-mcp
Similar issues
-
bug from-app needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
nightly-labs/openbot#21303 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ADORSYS-GIS/CoopData#282 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
OHDSI/Data2Evidence#3816 ·
Maintainers usually reply within 3 days
-
`ovsx verify` fails for a version older than the 100 newest of an extensionPossibly taken @trivikr claimed this today. Opencli
Difficulty 2/5 1-3 hours Newbie friendliness 81/100
eclipse-openvsx/openvsx#2482 · 2 comments ·
Maintainers usually reply within 1 day
-
bug builder-vite hmr sev:S3
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
storybookjs/storybook#37965 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day