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
[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 commit adds that solution to the documentation.
0 commit comments