You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minor #20362 [AssetMapper] Document usage of strict-dynamic in a CSP (nicwortel)
This PR was merged into the 6.4 branch.
Discussion
----------
[AssetMapper] Document usage of `strict-dynamic` in a CSP
AssetMapper will include special importmap entries for CSS files, which get resolved to `data:application/javascript`.
See https://symfony.com/doc/current/frontend/asset_mapper.html#handling-css.
Browsers will report those as CSP violations, as `data:` scripts can also be used for XSS attacks. For the same reason, allowing `data:` in the CSP is not a safe solution.
symfony/symfony#58416 (comment) provides a solution: using `strict-dynamic` in the `script-src` directive will allow the importmap to include other resources.
This PR adds that solution to the documentation.
Commits
-------
358ece7 [AssetMapper] Document usage of `strict-dynamic` in a CSP
0 commit comments