From 92e506820d13ad48b78d742eeb7328b3c33b2e4f Mon Sep 17 00:00:00 2001 From: Aleks Hudochenkov Date: Wed, 15 Sep 2021 18:28:55 +0200 Subject: [PATCH] Fix ReDoS issue (#5539) --- lib/rules/indentation/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rules/indentation/index.js b/lib/rules/indentation/index.js index 4e703bbf3a..c7fdb30fa4 100644 --- a/lib/rules/indentation/index.js +++ b/lib/rules/indentation/index.js @@ -628,7 +628,7 @@ function inferRootIndentLevel(root, baseIndentLevel, indentSize) { } const indents = []; - const foundIndents = /(?:^|\n)([ \t]*)\S[^\r\n]*(?:\r?\n\s*)*$/m.exec(root.raws.beforeStart); + const foundIndents = /(?:^|\n)([ \t]*)\S/m.exec(root.raws.beforeStart); // The indent level of the CSS code block in non-CSS-like files is determined by the shortest indent of non-empty line. if (foundIndents) {