Skip to content

Commit 62746bb

Browse files
committed
skip analyzing regular expressions in minified files for ReDoS
1 parent d0b70d1 commit 62746bb

File tree

1 file changed

+3
-1
lines changed
  • javascript/ql/src/semmle/javascript/security/performance

1 file changed

+3
-1
lines changed

javascript/ql/src/semmle/javascript/security/performance/ReDoSUtil.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ class RegExpRoot extends RegExpTerm {
112112
// there are no lookbehinds
113113
not exists(RegExpLookbehind lbh | getRoot(lbh) = this) and
114114
// is actually used as a RegExp
115-
isUsedAsRegExp()
115+
isUsedAsRegExp() and
116+
// is not inside a minified file.
117+
not getRootTerm().getParent().(Expr).getTopLevel().isMinified()
116118
}
117119
}
118120

0 commit comments

Comments
 (0)