-
Notifications
You must be signed in to change notification settings - Fork 146
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
[waiting for django5.1] Content Security Policy #2099
Conversation
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.
Haven't read modal commit yet, because we expect that to change after #1985 is merged. Looks good in general, some comments:
Current test failures are when a view aborts request processing and we thus defer to django's default handling for 400/500 responses. When rendering the template for those, the request does not have the annotated https://code.djangoproject.com/ticket/34830 fixes this, will have to wait for a django version that contains the change (probably 5.1?) |
Closing for now to clean up the PR list -- I'll keep it on my list and get back to this when 5.1 is released and we upgraded. |
Additional layer to prevent JavaScript injection. Still allows inline CSS and images to be exploited.
attr()
in CSS doesn't work with current browsers, at least for colors. The only workaround I currently see is having custom javascript that translatesdata-X
helper attributes for color into "inline" style (using the.style
attribute) -- seems a bit ugly to medata:
images we currently have (3 svg paths in CSS files) into separate files. These are currently inlined into CSS to use our color definitions.