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

'unsafe-inline' is ignored if either a hash or nonce value is present in the source list #31

Open
ace37 opened this issue Oct 3, 2018 · 9 comments

Comments

@ace37
Copy link

ace37 commented Oct 3, 2018

I got error while using this lib

image

@juunas11
Copy link
Owner

juunas11 commented Oct 3, 2018

That's not really related to this library, but how you are using Content Security Policy. You can't use inline styles if you specify a nonce.

@ace37
Copy link
Author

ace37 commented Oct 3, 2018

app.UseCsp(csp =>
            {
                csp.AllowScripts
                    .FromSelf()
                    .From("www.google.com")
                    .AllowUnsafeInline()
                    .AddNonce();
                csp.AllowStyles
                    .FromSelf()
                    .From("www.google.com")
                    .AllowUnsafeInline()
                    .AddNonce();
            });

@ace37
Copy link
Author

ace37 commented Oct 3, 2018

i dont use nonce on lib with inline style

@juunas11
Copy link
Owner

juunas11 commented Oct 3, 2018

But you have added a nonce to the CSP. Your browser is ignoring unsafe-inline since a nonce is in the CSP.

@ace37
Copy link
Author

ace37 commented Oct 3, 2018

how i can resolve it?

@ace37
Copy link
Author

ace37 commented Oct 3, 2018

Is it ok when i see empty nonce?

image

@rhux
Copy link

rhux commented Oct 29, 2018

Yes I'm seeing that issue too ... the helper tag isn't generating a nonce value.

@juunas11
Copy link
Owner

juunas11 commented Jan 1, 2019

I have been unable to reproduce this on Chrome. As a sidenote, Chrome's Elements view shows the attribute as empty but the value was actually delivered if you check the response in the Network tab.

@DeeAjith
Copy link

nonce will not be visible in inspect element if you rightclick the page and click on view source code there you can see the nonce values

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

4 participants