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

[Asset-Mapper] Errors with the mapper when using CSP #52675

Open
ph-il opened this issue Nov 21, 2023 · 2 comments
Open

[Asset-Mapper] Errors with the mapper when using CSP #52675

ph-il opened this issue Nov 21, 2023 · 2 comments

Comments

@ph-il
Copy link

ph-il commented Nov 21, 2023

Symfony version(s) affected

6.4.0-RC1

Description

When using CSP (like NelmioSecurityBundle) with Asset-Mapper, there's lot of blockage. Like need to open remote sites for scripts (when using the shim, and because the downloaded shim does't work), need to add unsafe-inline as it write JS in the html. By using 'unsafe-inline' or 'unsafe-eval' you're effectively disabling the XSS protection mechanism of CSP.

How to reproduce

Install NelmioSecurityBundle and start the CSP

Possible Solution

1- Have the same version of the shim downloaded.

2- We need to add nonce, to the script. Nonce that might need to be sync between Bundle.

Additional Context

No response

@smnandre
Copy link
Contributor

What is wrong with the downloaded shim? Could you elaborate a bit ?

I'm presuming you are referencing the local polyfill ?

For the CSP it's something that will be needed i agree, but i'd say it's more a "missing feature" than a bug :)

@weaverryan
Copy link
Member

Hi!

I'd also love to know if:

A) you're using the local polyfill
B) A replicator - or your exact Nelmio config.

Cheers!

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

No branches or pull requests

5 participants