openedx / license-manager

Django backend for managing licenses and subscriptions
GNU Affero General Public License v3.0
30 stars 30 forks source link

Add CSSSanitizer to sanitize_html #731

Closed macdiesel closed 1 week ago

macdiesel commented 1 week ago

Description

Bleach documentation suggests that if you want to use stye elements in your HTML tags you must also include a CSS sanitizer when calling bleach.clean.

https://bleach.readthedocs.io/en/latest/clean.html#allowed-attributes-attributes

Note

If you allow style, you need to also sanitize css. See [Sanitizing CSS](https://bleach.readthedocs.io/en/latest clean.html#clean-chapter-sanitizing-css) for details.