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

CSP Documentation missing style-src 'unsafe-eval'? #269

Open
kmindi opened this issue Jul 19, 2024 · 2 comments
Open

CSP Documentation missing style-src 'unsafe-eval'? #269

kmindi opened this issue Jul 19, 2024 · 2 comments

Comments

@kmindi
Copy link

kmindi commented Jul 19, 2024

Hi,

I have not yet created a MVP or anything similar to further dig down, but apparently the recommended settings https://docs.friendlycaptcha.com/#/csp miss a step about the style-src / style-src-elem.

The widget.module.js injects a style element, which is blocked on a page with the following Content-Security-Policy Error in Chrome:

widget.module.min.js:1 Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self' 'nonce-rD8UmTfY4BIp0ZHw'". Either the 'unsafe-inline' keyword, a hash ('sha256-DtJ0G5eArSV7tvvFUUeV7iyiWfBGflIkRW64/tmMWUk='), or a nonce ('nonce-...') is required to enable inline execution.

Thanks for confirming or looking into it. I'm happy to provide more information if needed and update this issue.

@merlinfuchs
Copy link
Member

merlinfuchs commented Jul 19, 2024

Hey, you are right that you have to add unsafe-inline to either style-src or default-src. I will look into why this isn't documented yet!

Alternatively, you can set skipStyleInjection and add your own style sheet (or copy ours) to style the widget. This way you can avoid the CSP issue.

@kmindi
Copy link
Author

kmindi commented Jul 19, 2024

Thanks already!, Yet, adding it seems to have no effect because we use a nonce, but don't know why it does not work with that nonce, it should be set at all places...

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