Skip to content

Commit

Permalink
fix backtracking vulnerability in block.pedantic.html as in markedj…
Browse files Browse the repository at this point in the history
  • Loading branch information
Feder1co5oave committed Mar 8, 2018
1 parent 4e2b647 commit 9cb1900
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/marked.js
Expand Up @@ -119,7 +119,7 @@ block.pedantic = merge({}, block.normal, {
html: edit(
'^ *(?:comment *(?:\\n|\\s*$)'
+ '|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)' // closed tag
+ '|<tag(?:"[^"]*"|\'[^\']*\'|\\s[^\'"/>]*)*?/?> *(?:\\n{2,}|\\s*$))')
+ '|<tag(?:"[^"]*"|\'[^\']*\'|\\s[^\'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))')
.replace('comment', block._comment)
.replace(/tag/g, '(?!(?:'
+ 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'
Expand Down

0 comments on commit 9cb1900

Please sign in to comment.