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

Cleanup embed CSP #99

Merged
merged 1 commit into from
Jul 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/vector/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Copy link
Contributor

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...

Copy link
Contributor Author

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

Copy link
Contributor

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.

Copy link
Contributor Author

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 ?

Copy link
Contributor

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)

Copy link
Contributor

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.

img-src * blob: data:;
connect-src *;
font-src 'self' data:;
Expand Down