I would like to use Content Security Policy for my JSF 2.1 based Web projects as I think it could improve protection against XSS attacks significantly.
Due to CSP's default behaviour to block all inline JavaScript it basically breaks JSF's
<f:ajax execute="input" render="output" />
functionality. This is because JSF generates lots of inline JavaScript code when using the above stated construct.
Does anybody know if there is a way to use CSP in JSF based projects which make use of f:ajax without the need to allow inline JS by using the following CSP directive:
Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline'
I know that manually placing all of the JavaScript in a separate file would be possible, but doing so I would be forced to do all the Ajax stuff manually.