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

Remove inline scripts #4031

Closed
5 tasks
core23 opened this issue Jul 31, 2016 · 5 comments
Closed
5 tasks

Remove inline scripts #4031

core23 opened this issue Jul 31, 2016 · 5 comments

Comments

@core23
Copy link
Member

core23 commented Jul 31, 2016

For many reasons, we should remove all scripts from the templates. We could replace them with data listerns like in the page bundle: sonata-project/SonataPageBundle#562.

General

Inline scripts couldn't be cached and would pollute the html output.

Security

There is also a security bundle which introduces some interesting information about security. You could completly disable inline script via a http header to reduce possible XSS attacks.

For more information: http://www.w3.org/TR/CSP/

Todo

The following files contains inline scripts and should be removed in the next major release, because this is a BC break.

Refs #2911

@greg0ire
Copy link
Contributor

Can you close duplicates of this?

@jordisala1991
Copy link
Member

There is an orm linked issue containing more scripts that were moved from orm to admin

@core23 core23 modified the milestones: 4.0, 5.0 Jan 28, 2020
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jul 26, 2020
@franmomu franmomu added keep and removed stale labels Jul 26, 2020
@fliespl
Copy link

fliespl commented Sep 8, 2020

How about to keep BC just utilize csp nonce functionality?

I.e. utilize <script nonce="{{ csp_nonce('script') }}"> from nelmio security bundle and fallback to own one?

Also - inline scripts/styles are not the only ones that should be taken care of.

I.e. highly secure setups require also no unsafe-inline usage which means that style="width: XXXpx" tags are also forbidden.

@VincentLanglet
Copy link
Member

Closing in favor of #7158

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

7 participants