From c1a2e2abe06bbdc533bb434150b9c00e7743d07c Mon Sep 17 00:00:00 2001 From: Asger F Date: Tue, 28 Jun 2022 10:21:33 +0200 Subject: [PATCH] JS: Rename to `isLikelyCaseSensitiveRegExp` --- .../ql/src/Security/CWE-178/CaseSensitiveMiddlewarePath.ql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/javascript/ql/src/Security/CWE-178/CaseSensitiveMiddlewarePath.ql b/javascript/ql/src/Security/CWE-178/CaseSensitiveMiddlewarePath.ql index a497f03f076..df3beecfb13 100644 --- a/javascript/ql/src/Security/CWE-178/CaseSensitiveMiddlewarePath.ql +++ b/javascript/ql/src/Security/CWE-178/CaseSensitiveMiddlewarePath.ql @@ -27,10 +27,10 @@ RegExpCharacterClass getEnclosingClass(RegExpTerm term) { } /** - * Holds if `term` distinguishes between upper and lower case letters, assuming the `i` flag is not present. + * Holds if `term` seems to distinguish between upper and lower case letters, assuming the `i` flag is not present. */ pragma[inline] -predicate isCaseSensitiveRegExp(RegExpTerm term) { +predicate isLikelyCaseSensitiveRegExp(RegExpTerm term) { exists(RegExpConstant const | const = term.getAChild*() and const.getValue().regexpMatch(".*[a-zA-Z].*") and @@ -89,7 +89,7 @@ predicate isCaseSensitiveMiddleware( ) and arg = call.getArgument(0) and regexp.getAReference().flowsTo(arg) and - isCaseSensitiveRegExp(regexp.getRoot()) and + isLikelyCaseSensitiveRegExp(regexp.getRoot()) and exists(string flags | flags = regexp.getFlags() and not RegExp::isIgnoreCase(flags)