- Posts: 2
- Thank you received: 0
Better support for CSP
10 Oct 2023 22:33 #8178
by SomeGuy
Better support for CSP was created by SomeGuy
First of all, thanks for your hard work bringing this extension to existence.
I'd love to use SermonSpeaker on my site, there is just one issue.
My site has a very strict CSP , allowing only scripts only from 'self' (aka. disallowing inline scripts), which breaks the plugin.
I usually solve this issue by generating hashes of the inline scripts and adding them to the CSP header.
This however doesn't work in this case, as some inline scripts have certain IDs (and names) hard coded into them:
I'd need to generate a new hash for every speaker I add and everything would break if I changed the name, which, simply put, just isn't an option.
would it be possible to either
Also, maybe I just overlooked something and there already is a solution for this.
Thanks a lot
I'd love to use SermonSpeaker on my site, there is just one issue.
My site has a very strict CSP , allowing only scripts only from 'self' (aka. disallowing inline scripts), which breaks the plugin.
I usually solve this issue by generating hashes of the inline scripts and adding them to the CSP header.
This however doesn't work in this case, as some inline scripts have certain IDs (and names) hard coded into them:
Code:
onclick="if (window.parent) window.parent.jSelectSpeaker_jform_speaker_id('3', 'Some Name', '10', 'index.php?option=com_sermonspeaker&view=sermon&id=3&Itemid=353');"
would it be possible to either
- move the scripts into a file (which would be allowed by
Code:script-src 'self'
- make it so that IDs and names are not hard coded into the inline scripts, which would make hashing a viable solution
Also, maybe I just overlooked something and there already is a solution for this.
Thanks a lot
Please Log in or Create an account to join the conversation.
- Thomas Hunziker
- Offline
- Administrator
10 Oct 2023 22:50 #8179
by Thomas Hunziker
Replied by Thomas Hunziker on topic Better support for CSP
I can't simply move them to a file since they are dynamically generated. I have to rewrite them to use data attributes so the generic Javascript can stay in a file.
But you're right, that is something I need to do as it is best practice nowadays. Unfortunately I need more time to write Javascript code than I need to write PHP stuff. Javascript is still a strange beast to me
But you're right, that is something I need to do as it is best practice nowadays. Unfortunately I need more time to write Javascript code than I need to write PHP stuff. Javascript is still a strange beast to me
The following user(s) said Thank You: SomeGuy
Please Log in or Create an account to join the conversation.
11 Oct 2023 07:17 #8180
by SomeGuy
Replied by SomeGuy on topic Better support for CSP
Wow, didn't expect such a quick reply.
Yeah, without looking at the code, I was already afraid that it wouldn't be a quick fix.
I can relate to the JavaScript part though, weird stuff If I find the time I might be able to contribute some code. I do know my way around JavaScript and PHP, just not in the context of Joomla, so we'll see...
Yeah, without looking at the code, I was already afraid that it wouldn't be a quick fix.
I can relate to the JavaScript part though, weird stuff If I find the time I might be able to contribute some code. I do know my way around JavaScript and PHP, just not in the context of Joomla, so we'll see...
Please Log in or Create an account to join the conversation.
Time to create page: 0.109 seconds