Skip to content

fix(csp): allow worker-src 'self' blob: for Clerk - #18

Merged
DHYEY166 merged 1 commit into
mainfrom
fix/csp-worker-src
Oct 3, 2026
Merged

DHYEY166 merged 1 commit into
mainfrom
fix/csp-worker-src

Conversation

@DHYEY166

@DHYEY166 DHYEY166 commented Oct 3, 2026

Copy link
Copy Markdown
Owner

What

Add worker-src 'self' blob: to the CSP built by src/lib/csp.ts, which next.config.ts sets on every response. No other directive changes.

Why

Clerk starts Web Workers from blob: URLs. The policy had no worker-src, so browsers fell back to script-src, which doesn't allow blob:, and the console logged blocked-worker errors.

Verified

  • csp.test.ts: the pinned production policy gains exactly this directive, and a new test asserts it.
  • npx vitest run (236 passed), eslint and tsc are clean.

After merge

Nothing beyond the normal Vercel production deploy. The CSP is set at build time.

Clerk creates Web Workers from blob: URLs. The policy had no worker-src,
so browsers fell back to script-src, which does not allow blob:, and the
console filled with CSP violations. Add worker-src 'self' blob: and leave
every other directive unchanged (the pinned production policy in
csp.test.ts gains exactly this directive).
@vercel

vercel Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
clean-stack Ready Ready Preview Oct 3, 2026 12:59am UTC
cleanstack Ready Ready Preview, v0 Oct 3, 2026 12:59am UTC

@DHYEY166
DHYEY166 merged commit a167c33 into main Oct 3, 2026
9 checks passed

This branch was successfully deployed

2 active deployments
Preview – cleanstack — e13a42cf Deployed Oct 3, 2026 by vercel[bot]
Preview – clean-stack — e13a42cf Deployed Oct 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant