Skip to content

Commit

Permalink
[security] fix possible ReDOS vulnerable regex rule by refactoring (d…
Browse files Browse the repository at this point in the history
…oesn't change the alphabet)
  • Loading branch information
Feder1co5oave committed Mar 5, 2018
1 parent 29d33d9 commit 271d357
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 @@ -38,7 +38,7 @@ var block = {
};

block._label = /(?:\\[\[\]]|[^\[\]])+/;
block._title = /(?:"(?:\\"|[^"])*"|'\n?(?:[^'\n]+\n?)*'|\([^()]*\))/;
block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
block.def = edit(block.def)
.replace('label', block._label)
.replace('title', block._title)
Expand Down

0 comments on commit 271d357

Please sign in to comment.