Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relaxed content security policy #76

Open
lsrepo opened this issue Mar 9, 2020 · 1 comment
Open

Relaxed content security policy #76

lsrepo opened this issue Mar 9, 2020 · 1 comment

Comments

@lsrepo
Copy link

lsrepo commented Mar 9, 2020

A line in the manifest file may pose security issue due to relaxed content security policy.

"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'"

However, we strongly recommend against doing this. These functions are notorious XSS attack vectors.

CSP discussed in Chrome Developer Documentation

I understand it is done to allow the eval script to be run in webpack dev server. But this should be removed in the production build. One way to do it is adding some reduction here:

transform: function (content, path) {

@WofWca
Copy link

WofWca commented Jul 25, 2020

Changing source mapping method worked for me, with no need to change CSP:

module.exports = {
  devtool: process.env.NODE_ENV === 'production'
    ? 'source-map'
    : 'inline-source-map',

  ...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants