Skip to content

Commit 0ff371b

Browse files
Markup: Fixed ReDoS (#3078)
1 parent d216e60 commit 0ff371b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

components/prism-markup.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Prism.languages.markup = {
2-
'comment': /<!--[\s\S]*?-->/,
2+
'comment': /<!--(?:(?!<!--)[\s\S])*?-->/,
33
'prolog': /<\?[\s\S]+?\?>/,
44
'doctype': {
55
// https://www.w3.org/TR/xml/#NT-doctypedecl

components/prism-markup.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

prism.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@ if (typeof global !== 'undefined') {
12311231
********************************************** */
12321232

12331233
Prism.languages.markup = {
1234-
'comment': /<!--[\s\S]*?-->/,
1234+
'comment': /<!--(?:(?!<!--)[\s\S])*?-->/,
12351235
'prolog': /<\?[\s\S]+?\?>/,
12361236
'doctype': {
12371237
// https://www.w3.org/TR/xml/#NT-doctypedecl

0 commit comments

Comments
 (0)