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

Content Security Policy for public sites

For public bodies - what Exponential's Content Security Policy does, how it is shipped (report-only on the administration, off on public sites), where violation reports go, and why enforcing it is worth the effort for a…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/government/security/content-security-policy.md

On this page

Content Security Policy for public sites

This page is for administrators and developers of public sites. A Content Security Policy tells the browser which scripts, styles, images and connections a page may use; with a strict policy a script injected through a stored or reflected value does not run, even where a template forgets to escape it. Public sites are attractive targets for defacement and for injecting scripts into trusted pages, so the policy is a strong second line of defense (Content Security Policy).

Contents

  1. How it ships
  2. The settings
  3. Reports
  4. What breaks under an enforced policy
  5. Related pages

How it ships

SiteaccessMode=auto gives
administration (design begins with admin, or an editor siteaccess on admin4l)report-only: the browser reports what it would block and blocks nothing
public sitesno policy

The project rates its CSP support Partly complies with CSP Level 3 (https://www.w3.org/TR/CSP3/); enforcement is a per-siteaccess decision of the operator (Security standards: Content Security Policy Level 3). Independently, SecurityHeaders[Content-Security-Policy]=frame-ancestors 'self' limits framing on every page.

The settings

settings/site.ini [ContentSecurityPolicy]:

SettingShippedMeaning
Modeautodisabled, report-only, enforce or auto
Directives[]default-src 'self', script-src 'self', style-src 'self', object-src 'none', base-uri 'self', form-action 'self', frame-ancestors 'self' and othersthe policy
AdditionalSources[]emptyadd hosts to a directive without restating it
Nonce, NonceDirectives[]enabled, script-srca per-request nonce for <script nonce="{csp_nonce()}">
ReportOnlyDesigns[]admin, admin2, admin_classicclassic designs stay report-only even when enforced
ReportEndpointdisabledenabled sends reports to the site's own csp/report view
ReportOnlyDirectives[]emptywith enforce: a stricter report-only companion policy

Reports

With ReportEndpoint=enabled the browser's reports go to csp/report, which writes one line per violation to var/log/csp.log, shown under Setup > Log files as "Content Security Policy reports". The view is open to every visitor (browsers send reports without signing in), rate limited per client and in total, answers without a body, and writes a flood as one abuse/csp-report-flood line a minute to security.log. ReportURI can name an external collector instead.

What breaks under an enforced policy

  • Inline scripts and event handler attributes in templates of your design or of extensions.
  • Context menu entries of some extensions that use inline scripts (the feature page names xrowextract, ezodf and ezmultiupload); they are drawn but do nothing.
  • TinyMCE 3, which writes handler attributes; the editor falls back to TinyMCE 8 unless the siteaccess allows 'unsafe-inline'.
  • Third-party embeds (maps, video, analytics, CAPTCHAs) until their hosts are added with AdditionalSources[].

The admin4, admin4l and AdminUI administrations are written to run under an enforced policy; a test fails on inline scripts, handlers, javascript: URLs and style="" in admin4 and admin4l templates.

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