I have made a web app in gwt, CSP Mitigator is saying that, I have many eval statements and javascript uri's in js loaded, so my project is not Strict CSP Compatible .
But problem in my case is that, I write code in java and gwwt make js for me.
I also asked gwt community, but they says that in next release of gwt, csp compliance will be covered.
But till then, Do anyone knows, how can I solve this vulnerability .
strict-dynamic in CSP. The strict-dynamic source list keyword allows you to simplify your CSP policy by favoring hashes and nonces over domain host lists.
If scripts are loaded from a whitelisted domain in the AngularJS application, then it is possible to bypass CSP policy. This can be done by calling a callback function and vulnerable class.
To enable CSP, you need to configure your web server to return the Content-Security-Policy HTTP header. (Sometimes you may see mentions of the X-Content-Security-Policy header, but that's an older version and you don't need to specify it anymore.)
Once the page source is shown, find out whether a CSP is present in a meta tag. Conduct a find (Ctrl-F on Windows, Cmd-F on Mac) and search for the term “Content-Security-Policy”. If “Content-Security-Policy” is found, the CSP will be the code that comes after that term.
Release Of gwt 2.8.2 has come which is csp compliance .
Not entirely out of box, just improved CSP support in gwt-2.8.2.
For instance GWT compiled js includes data URLs such as data:image/gif;base64.. and will violate img-src 'self';
It is awkward including such URLs in CSP. More worse using img-src 'self' data:; as hackers can inject anything in data scheme.
This can be turned off in module gwt.xml. Disable the use of data: URLs
<set-property name="ClientBundle.enableInlining" value="false" />
There are also pending CSP issues where GWT code base still uses eval that require unsafe-eval in CSP declarations.
Additionally, this is an issue since it violates CSP, as eval isn't particularly safe, and some sites would like to forbid its use to further protect their data and their users.
https://github.com/gwtproject/gwt/issues/9578
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With