-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: sanitize HTML tags to prevent XSS vulnerabilities
This allows rendering only a pre-defined set of HTML tags and their attributes. It also escapes all HTML code in the zone preview inside the Studio editor. An alternative could be sanitizing this data with `bleach` before passing it to the Studio editor (i.e. in the `studio_view`). This would provide a consistent experience between the rendered XBlock and this preview. However, this would lead to overwriting existing data - i.e. when a course author submits the XBlock, the sanitized data will replace the one from the XBlock field (which has the `Scope.settings` scope). Therefore, we decided to just escape the HTML with `Handlebars.Utils.escapeExpression` in the preview. BREAKING CHANGE: disallowed HTML tags (e.g. `<script>`) will no longer be rendered in LMS and Studio.
- Loading branch information
1 parent
d386716
commit 53c4482
Showing
7 changed files
with
149 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters