You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Offline

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

Please create a new Ticket and we will get back to you as soon as we can.

#114795 Content Security Policy settings

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by Ryan on Thursday, 05 October 2023 10:01 BST

MocerJCE
Hi there,

I'm trying to make a Content Security Policy using the wizard at a website called report-uri.com. This wizard will show you the detected items on a website. I let it ran for a week and the detected items contained a lot of 'unsafe-inline', 'unsafe-eval' directives:

default-src 'unsafe-inline'
script-src-attr 'unsafe-inline'
script-src-elem 'unsafe-inline'
script-src 'unsafe-eval'
script-src 'unsafe-inline'
style-src-attr 'unsafe-inline'
style-src-elem 'unsafe-inline'
style-src 'unsafe-inline'

In my opinion the website will remain vulnerable when whitelisting these in the CSP. Are there specific directives that should have the 'unsafe-inline' or 'unsafe-eval' expressions for JCE editor (or other products) to work properly?

Thanks in advance!

Ryan
I've done some tests with JCE Pro using the Joomla System - HTTP Headers plugin in Joomla 4 which you can use to set various header options for the site, including the CSP.

There is a fantastic article about this plugin here - https://blog.astrid-guenther.de/en/cassiopeia/10content-security-policy-joomla4/

I enabled the "Nonce" option and set two Policy Directives of script-src : 'self' and object-src : 'none'.

Note that I set this to Report-Only and used the browser console to show any errors in the report.

There were a few warnings with JCE Pro 2.9.50, but these are now fixed in JCE Pro 2.9.51 Beta - https://www.joomlacontenteditor.net/downloads/editor/pro/development

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.