Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

Checklist: CSP

A Content Security Policy checklist for a design: no inline scripts, handlers, javascript links or inline styles, configuration as JSON data, pre-paint code in files, nonces never in cached output, third-party origins…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/designers/theme-design/checklist-csp.md

On this page

Checklist: CSP

This page is for designers and developers who make sure a design works under an enforced Content Security Policy. Background: CSP-safe design.

Contents

  1. Templates
  2. Scripts and styles
  3. Origins
  4. Before enforcing

Templates

  • To do: No <script> element with code (a src script, a JSON data block and a <template> are fine).
  • To do: No on*= handler attributes.
  • To do: No javascript: URLs.
  • To do: No <style> blocks and no style="" attributes (No inline CSS).
  • To do: csp_nonce() only where a file is truly impossible, and never inside a cache-block or a view-cached template.
grep -rn -E "<script>|on(click|change|load|submit|input|keyup|keydown|focus|blur|mouseover)=|javascript:|<style|style=\"" \
     extension/mytheme/design --include=*.tpl

Scripts and styles

  • To do: Every script is a file under javascript/, loaded with the ezjscore operators (No inline JavaScript).
  • To do: Values for scripts come from data-* attributes or <script type="application/json"> blocks.
  • To do: Code that must run before the first paint is a small file loaded in the head.
  • To do: No eval, new Function or string arguments to setTimeout in the design's scripts.

Origins

  • To do: Every third-party origin the design needs is listed in the theme's README, with the directive it needs.
  • To do: Fonts, icons and libraries are local unless there is a reason.

Before enforcing

  • To do: The siteaccess ran with [ContentSecurityPolicy] Mode=report-only while every page type and every dialog was used.
  • To do: The browser console and var/log/csp.log (with ReportEndpoint=enabled) show no reports for the design.
  • To do: For admin designs and extensions: AdminContentSecurityPolicyTest and ExtensionInlineScriptsTest pass.
  • To do: Then Mode=enforce on one siteaccess first, INI cache cleared, PHP reloaded.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x