Magento 2.3.5-p1 the frontend is blank due to Content Security Policy

Magento 2.3.5-p1 the frontend is blank due to Content Security Policy

October 12, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento 2.3.5-p1 the frontend is blank due to Content Security Policy

Solving the Magento 2.3.5-p1 Content Security Policy Issue

Dear Magento store owners,

If you’ve recently upgraded to version 2.3.5-p1 and are now facing a blank frontend with error messages about violated Content Security Policies, don’t panic—we’re here to help!

Understanding the Issue

After the upgrade, your Magento site may display blank pages with console errors like this:

[Report Only] Refused to load the stylesheet 'http://static.domain.com/pub/static/version1633097154/frontend/Magento/luma/en_US/mage/calendar.css' because it violates the following Content Security Policy directive: "style-src 'self' https: blob: data:".

This happens due to a change in the way Magento handles static content deployment. The new version updates the security policies but doesn’t automatically adjust your existing configuration.

Step-by-Step Solution

1. Check Your Deployment Process

Ensure that you’ve correctly deployed the static and media contents for the new version:

  • Run bin/magento setup:static-content:deploy to deploy all static content.
  • Make sure the pub/static folder contains the updated files.

2. Modify the Security Policies

You can modify the security policies in two ways:

Option A: Via the Admin Panel

  1. Login to your Magento admin panel (e.g., admin.domain.com/admin/.
  2. Navigate to Stores > Settings > Configuration.
  3. Under General, select Web.
  4. Scroll down to Security and find the “Security Policies” section.

Security Policies Section

  1. Modify the policies as necessary to match your domain setup:

    • For static.domain.com: Set style-src to 'self' http: https: blob: data:
    • For media.domain.com: Set img-src to 'self' http: https: and add http: //www.static.domain.com/ as an exception.
  2. Click Save Config and then run bin/magento cache:flush.

Option B: Via the .htaccess File

If you can’t modify the admin panel settings, you can manually update the .htaccess file located in the root directory of your Magento installation:

  1. Open a text editor.
  2. Add the modified policies to the bottom of the Environment section:
<IfModule mod_headers.c>
    <IfModule mod_setenvif.c>
        # set environment variable for the actual path
        SetEnvIf X-Forwarded-Proto "https" HTTPS=on

        # force https redirect if not already forced by other rules
        Header always set X-Frame-Options "SAMEORIGIN"
        Header always set X-XSS-Protection "1; mode=block"
        Header always set X-Content-Type-Options "nosniff"

        # Content Security Policy (CSP) settings
        if (HTTPS != on) {
            Header set Content-Security-Policy "style-src 'self' http: https: blob: data:"
            Header set X-XSS-Protection "0"
            Header set X-Frame-Options "ALLOWALL"
        }
    </IfModule>
</IfModule>
  1. Save the file and upload it back to your server.
  2. Run bin/magento cache:flush from the command line.

Conclusion

Remember, security is a top priority for Magento.

Always ensure you follow Magento’s official upgrade guide to avoid potential issues like this one.

If you still encounter difficulties after trying these steps, or if your site requires additional customizations, don’t hesitate to contact our expert team at Laravel Company.

Stay secure and happy coding!

Magento 2 Security Themes Admin

Our network