Skip to content

Commit 0e059ce

Browse files
authored
Merge pull request #5000 from erik-krogh/redosOnlyNonMin
Approved by esbena
2 parents d0b70d1 + 11f35a5 commit 0e059ce

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+
// pragmatic performance optimization: ignore minified files.
117+
not getRootTerm().getParent().(Expr).getTopLevel().isMinified()
116118
}
117119
}
118120

0 commit comments

Comments
 (0)