SharedWorker and AudioWorklet bypass --blockedUrlPattern/--allowedUrlPattern
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 8/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, typescript
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 59.8k
- Fork
- 4.8k
- Merge medio
- 2g 10h
- PR unite (30g)
- 162
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ChromeDevTools/chrome-devtools-mcp
-
feature
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
ChromeDevTools/chrome-devtools-mcp#3689 ·
I maintainer di solito rispondono entro 1 giorno
-
`evaluate_script` `sourcePath` http(s) URLs are mangled into `file://` pathsForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertacollecting-feedback
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ChromeDevTools/chrome-devtools-mcp#3453 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
collecting-feedback feature
Difficoltà 2/5 Mezza giornata Idoneità per principianti 76/100
ChromeDevTools/chrome-devtools-mcp#3225 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
`wait_for` never finds visible text whose HTML source contains line breaks or repeated spacesApertaconfirmed p3
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ChromeDevTools/chrome-devtools-mcp#2947 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Project Migration: Moving to devtools-frontendForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 1/100
ChromeDevTools/chrome-devtools-mcp#3648 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di ChromeDevTools/chrome-devtools-mcp
Issue simili
-
[Bug]: Team (channel) avatars render noticeably smaller than agent avatars in the sidebar gridApertabug from-app needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
nightly-labs/openbot#21303 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
ADORSYS-GIS/CoopData#282 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
OHDSI/Data2Evidence#3816 ·
I maintainer di solito rispondono entro 3 giorni
-
`ovsx verify` fails for a version older than the 100 newest of an extensionForse già presa @trivikr l’ha presa oggi. Apertacli
Difficoltà 2/5 1-3 ore Idoneità per principianti 81/100
eclipse-openvsx/openvsx#2482 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug builder-vite hmr sev:S3
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
storybookjs/storybook#37965 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno