Skip to content

Commit b0c86d8

Browse files
committed
change string match to regex match
1 parent 2bbd37f commit b0c86d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

java/ql/src/experimental/Security/CWE/CWE-089/MyBatisCommonLib.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ predicate isMybatisXmlOrAnnotationSqlInjection(
154154
or
155155
unsafeExpression.matches("${arg" + i + "%}")
156156
or
157-
unsafeExpression.matches("${" + ma.getMethod().getParameter(i).getName() + "}")
157+
unsafeExpression.regexpMatch("\\$\\{\\s*" + ma.getMethod().getParameter(i).getName() + "\\s*(,.*?)?\\s*\\}")
158158
) and
159159
ma.getArgument(i) = node.asExpr()
160160
)

0 commit comments

Comments
 (0)