Skip to content

fix(csp): patch zod to remove CSP violation#112860

Open
natemoo-re wants to merge 2 commits intomasterfrom
nm/csp/zod
Open

fix(csp): patch zod to remove CSP violation#112860
natemoo-re wants to merge 2 commits intomasterfrom
nm/csp/zod

Conversation

@natemoo-re
Copy link
Copy Markdown
Member

Patches Zod's allowsEval helper to unconditionally return false, bypassing the new Function('') CSP check that Sentry's strict CSP always blocks anyway.

This eliminates console warnings and a recurring Sentry CSP error (SENTRY-CSP-GVM, upstream zod#5789) with no runtime cost.

Uses pnpm patch so the change is re-evaluated on each Zod upgrade.

Alternative considered: the official "fix" here is calling z.config({ jitless: true }) before zod is called elsewhere, but this is fragile as it relies on import ordering which cannot be guaranteed by the bundler.

@natemoo-re natemoo-re requested a review from a team as a code owner April 13, 2026 21:23
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 13, 2026
@natemoo-re natemoo-re requested a review from oioki April 13, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant