-
Notifications
You must be signed in to change notification settings - Fork 5
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
Cleanup embed CSP #99
Conversation
@@ -26,7 +26,7 @@ | |||
<meta http-equiv="Content-Security-Policy" content=" | |||
default-src 'none'; | |||
style-src 'self' 'unsafe-inline'; | |||
script-src 'self' 'unsafe-eval' https://www.recaptcha.net https://www.gstatic.com; | |||
script-src 'self' 'unsafe-eval'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on pourrait pas enlever unsafe-eval aussi ?
J'ai pas trouvé de eval
dans le code.
Ya d'autres fonctions que ca pourrait bloquer, que j'ai pas cherché : https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src#unsafe_eval_expressions
Après, ca serait ptet un peu tricky à repérer si ca casse des trucs...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ça serait top d'enlever les unsafe eval mais je ne sais pas l'impact, on peut tester à la rigueur
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Si on l'enlève, ça casse au moins le run de dev parce que webpack fait un eval pour se lancer. En revanche, c'est ptet pas un problème pour la prod. Mais je pense que c'est suffisant pour le moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
il y a des CSP qui impact le webpack ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Si je l'enlève, j'ai un message de violation de CSP sur le eval(...contenuAvecDuWebpackDedans...) dans bundle.js et l'appli ne se charge pas avec yarn start. C'est aussi possible de contourner ça en mettant en inline les scripts et utiliser le CSP d'inline mais je sais pas c'est quoi les implications niveau chargement après (package/chargement initial plus gros) (valable pour le CSS aussi)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible que ça soit lié à une lib que l'on utilise et qui se retrouve dans les fichiers compilés et qui respecte pas le CSP (vu sur le net), mais je sais pas comment trouver le coupable.
We don't want recaptcha and gstatic
This PR currently has no changelog labels, so will not be included in changelogs.
Add one of:
T-Deprecation
,T-Enhancement
,T-Defect
,T-Task
to indicate what type of change this is plusX-Breaking-Change
if it's a breaking change.