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

V3 with CSP nonce #299

Open
dr4t opened this issue Mar 9, 2023 · 0 comments
Open

V3 with CSP nonce #299

dr4t opened this issue Mar 9, 2023 · 0 comments

Comments

@dr4t
Copy link

dr4t commented Mar 9, 2023

I'm implementing Content Security Policy with nonce on my website and I'm trying to get recaptcha working with EWZ V3. I pass the generated nonce to EWZ using the "script_nonce_csp" option, but the recaptcha JS script is not permitted to be loaded because the EWZ library does not provide the nonce to the script tag. More details below:

File: src/Resources/views/Form/v3/ewz_recaptcha_widget.html.twig
Line: 4
Current value: <script src="{{ form.vars.ewz_recaptcha_api_uri }}?render={{ form.vars.public_key }}"></script>
Proposed value: <script src="{{ form.vars.ewz_recaptcha_api_uri }}?render={{ form.vars.public_key }}" {% if form.vars.script_nonce_csp is defined and form.vars.script_nonce_csp is not same as('') %} nonce="{{ form.vars.script_nonce_csp }}"{% endif %}></script>

Is this correct, or am I doing something wrong when implementing it? Please let me know. Thank you.

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

1 participant