change string match to regex match

This commit is contained in:
retanoj
2022-12-06 21:50:09 +08:00
parent 2bbd37f9ab
commit b0c86d8e51

View File

@@ -154,7 +154,7 @@ predicate isMybatisXmlOrAnnotationSqlInjection(
or
unsafeExpression.matches("${arg" + i + "%}")
or
unsafeExpression.matches("${" + ma.getMethod().getParameter(i).getName() + "}")
unsafeExpression.regexpMatch("\\$\\{\\s*" + ma.getMethod().getParameter(i).getName() + "\\s*(,.*?)?\\s*\\}")
) and
ma.getArgument(i) = node.asExpr()
)