securedrop.org
securedrop.org copied to clipboard
Remove unsafe-eval from CSP
Follow-up to #431. As @emkll noted over there:
unsafe-evalis required for client/common/js/common.js:645 and /client/tor/js/torEntry.js:89. We should consider fixing this, as it would be another big win.
@harrislapiroff adds:
Currently it has in the policy
unsafe-evalmeaning that javascripteval()statements will run. This is necessary because of the way webpack is compiling our javascript, but it would be ideal to get rid of this. I'm looking into why webpack is usingevalfor compilation (you can see my comments above for the state of the research).
Let's clean up the JS until we can remove unsafe-eval from the CSP_SCRIPT_SRC directive altogether.