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

Ability to override (and disable) hash #243

Open
drzraf opened this issue Sep 8, 2021 · 3 comments
Open

Ability to override (and disable) hash #243

drzraf opened this issue Sep 8, 2021 · 3 comments

Comments

@drzraf
Copy link

drzraf commented Sep 8, 2021

In config/packages/dev/nelmio_security.yaml I'm trying to override hash (which keeps me from using unsafe-inline on my dev environment where I test and have some inlined event handlers).
Thus I use

nelmio_security:
    csp:
        hash: {}

(and other similar syntax).

Still, no way to disable it.
Worst, since {% cspscript %} are in the templates, even dropping hash from the main config/packages/nelmio_security.yaml is not enough (as it keeps sending sha256-* to the browser).

I think computeForScript should take the configuration into consideration.

@sstok
Copy link

sstok commented Sep 10, 2021

The {} is considered empty, and will use the default configuration. It's not possible to disable this configuration (which would be false).

Disabling this for CSP would actually defeat the purpose of CSP.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src maybe the 'unsafe-hashes' option can help here.

@drzraf
Copy link
Author

drzraf commented Sep 10, 2021

I will try 'unsafe-hashes' but my purpose was exactly that: Disabling CSP (for my -dev environment) without having to change my markup.

@drzraf
Copy link
Author

drzraf commented Sep 10, 2021

https://bugzilla.mozilla.org/show_bug.cgi?id=1343950 (Not supported by FF)

(Overriding hash would be really useful)

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

2 participants