Skip to content

fix(csp): add unsafe-eval to unblock Matomo Cloud tracker#165

Merged
marc0olo merged 1 commit into
mainfrom
infra/fix-csp-unsafe-eval
Apr 28, 2026
Merged

fix(csp): add unsafe-eval to unblock Matomo Cloud tracker#165
marc0olo merged 1 commit into
mainfrom
infra/fix-csp-unsafe-eval

Conversation

@marc0olo
Copy link
Copy Markdown
Member

Summary

  • Adds 'unsafe-eval' to the script-src CSP directive to unblock the Matomo Cloud analytics tracker

Background

The Matomo Cloud-hosted matomo.js bundles account-enabled plugins (e.g. Form Analytics, Heatmaps) that call eval() internally. Our CSP had 'wasm-unsafe-eval' (for Pagefind/WebAssembly) but not 'unsafe-eval', causing the tracker to be blocked.

This matches what the old portal did in its .ic-assets.json.

Better long-term fix

Disable the offending plugins in the Matomo Cloud dashboard (under Plugins/Features) so the bundled matomo.js no longer needs eval(). Once confirmed, remove 'unsafe-eval' from this CSP. Tracked in the inline comment added to .ic-assets.json5.

Sync recommendation

hand-written

@marc0olo marc0olo merged commit 1ff0264 into main Apr 28, 2026
1 check passed
@marc0olo marc0olo deleted the infra/fix-csp-unsafe-eval branch April 28, 2026 16:04
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