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 7a9eeaa commit e20dd02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/marked.js
Original file line number Diff line number Diff line change
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 e20dd02

Please sign in to comment.