Merge pull request #219 from edx/matthugs/EDUCATOR-5555-a11y-js-code-for-notes-needs-to-handle-tags-better

Fix XSS vector for a11y text attached to notes editor
This commit is contained in:
Matt Hughes
2021-02-08 16:54:49 -05:00
committed by GitHub

View File

@@ -165,7 +165,7 @@
.addField({
load: function(field, annotation) {
if (annotation.text) {
$(field).html(HtmlUtils.HTML(Utils.nl2br(annotation.text)).toString());
$(field).html(HtmlUtils.HTML(Utils.nl2br(Annotator.Util.escape(annotation.text))).toString());
} else {
// eslint-disable-next-line max-len
$(field).html(HtmlUtils.joinHtml(HtmlUtils.HTML('<i>'), _t('No Comment'), HtmlUtils.HTML('</i>')).toString());