mirror of
https://github.com/status-im/codimd.git
synced 2025-01-14 19:34:08 +00:00
Fix unclosed tags might cause XSS [Security Issue]
This commit is contained in:
parent
d1d6d5810b
commit
9b00afb863
@ -27,7 +27,7 @@ var filterXSSOptions = {
|
||||
whiteList: whiteList,
|
||||
escapeHtml: function (html) {
|
||||
// allow html comment in multiple lines
|
||||
return html.replace(/<(.*?)>/g, '<$1>')
|
||||
return html.replace(/<(?!!--)/g, '<').replace(/-->/g, '__HTML_COMMENT_END__').replace(/>/g, '>').replace(/__HTML_COMMENT_END__/g, '-->')
|
||||
},
|
||||
onIgnoreTag: function (tag, html, options) {
|
||||
// allow comment tag
|
||||
|
Loading…
x
Reference in New Issue
Block a user