Content Security Policy configuration conflicts in AEM

Strict Content Security Policy (CSP) rules often break the AEM Author UI, trigger scanner warnings about missing CSP headers, or cause deployment issues when CSP is applied across Author and Publish environments. Configure CSP on the Dispatcher or CDN layer, exempt Author environments from strict policies, and apply CSP only where required.

Description description

Environment

  • Adobe Experience Manager as a Cloud Service (AEMaaCS)
  • AEM Managed Services
  • Adobe Developer App Builder

Issue/Symptoms

  • Author UI toolbars, components, or iframes fail to load.
  • Security scanners report missing CSP headers on login pages.
  • Sites stop functioning after applying restrictive CSP directives such as default-src ‘self’.
  • CSP directives that restrict unsafe-inline or unsafe-eval cause UI failures.
  • No built-in CSP reporting endpoint is available.

Cause

AEM does not provide comprehensive CSP support out of the box. Many core client libraries depend on inline JavaScript and behaviors that are incompatible with strict CSP policies. Applying CSP globally can unintentionally affect Author environments. CSP nonces are not generated by default and require custom implementation. Login pages also do not include CSP headers by default.

Resolution resolution

To resolve this issue, follow these steps:

  1. Identify where the CSP header is configured, such as the CDN, Dispatcher, or reverse proxy layer.
  2. Use separate hostnames for Author and Publish environments.
  3. Remove or exempt CSP headers from Author environments to prevent authoring interface failures.
  4. Apply CSP only to Publish environments.
  5. If stricter policies are required, use domain whitelisting or implement a custom nonce solution.
  6. Host CSP reporting endpoints outside the platform if reporting is required.
  7. Apply CSP at the outermost layer, such as the CDN or reverse proxy, for consistent enforcement.
  8. Add CSP headers to login pages only when required to satisfy security scanning requirements.
  9. Validate the configuration by confirming that required resources load successfully and no critical CSP violations occur.
recommendation-more-help
experience-cloud-kcs-help-kbarticles