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

When script-src is set to strict-dynamic, 2 nonces are listed in CSP header #336

Open
eliseeman opened this issue Feb 20, 2024 · 1 comment

Comments

@eliseeman
Copy link

In the nelmio_security.yaml csp section, we have set script-src to 'strict-dynamic' (while commenting out unsafe-inline), and we are invoking csp_nonce('script') in target pages.
yaml
When doing so, the Content-Security-Policy header for requested pages lists script-src as 'unsafe-inline' as well as 'strict-dynamic', and two nonces are listed.
csp
Is there a reason for two nonces in this scenario?

@Seldaek
Copy link
Member

Seldaek commented Feb 21, 2024

the unsafe-inline is just for compatibility with older browsers not supporting nonces. The two nonces I'm not sure why, maybe you used csp_nonse twice with different arguments? Try to check in the html source where the two nonce values are being used?

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