Etherpad-lite: Question: What CSP headers to add to secure for etherpad

Created on 9 Dec 2016  ·  7Comments  ·  Source: ether/etherpad-lite

Hi there,
I don't really understand CSP so I fail to compose the right CSP config for my etherpad instance. Can anyone here give me an example of what it should be to keep Etherpad working but improve security on it?
I think it could improve documentation when such examples are added.
Thanks a lot.

Waiting on Testing wontfix

All 7 comments

Note on Video.etherpad.com the results are

image

A simple npm install ep_helmet or install ep_helmet through the plugin installation UI will get you a B rating on Observatory. https://observatory.mozilla.org/analyze/video.etherpad.com

The scope of the issue was "what CSP headers" but I did go off on a bit of a tangent and decided to cover a lot more of the header related exploits available to attackers. This gives admin a "one click" solution to increase security.

This doesn't "fix" the question of the correct CSP headers yet. CSP in general is a bitch to implement in Etherpad due to there being SO MUCH inline JS. So damn much. And afaik it's dynamic so I need to take the nonce approach and that means touching a lot of files. I'm not even sure it's possible but I'm going to try spend a few more hours on it and see where I get to. It's worth the effort even if it just confirms we need to move the javascript out of the html files. Imho unsafe-eval and unsafe-inline are the 2 biggest vectors that are worth the effort addressing.. Maybe tomorrow..

https://github.com/johnmclear/ep_helmet

Okay cool and now a merge request is in for CSP and I am going to publish an updated helmet.

Waiting on @muxator to review.

My concern with my fix btw is that plugins often use inline js so if you enable strict csp policy it will mean some of them won't work

I rebased today. This PR is so involved that I don't want to merge it myself.

The PR just handles nonce's, it isn't great for fixing the inlineJS issues but for the most npm install ep_helmet saves the day :)

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings