Skip to content

Commit ce2ba21

Browse files
committed
Add binding between annotation and sink-param
1 parent d799466 commit ce2ba21

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ predicate isMybatisXmlOrAnnotationSqlInjection(
134134
.matches("${" + annotation.getValue("value").(CompileTimeConstantExpr).getStringValue() +
135135
"%}") and
136136
annotation.getType() instanceof TypeParam and
137-
ma.getAnArgument() = node.asExpr()
137+
ma.getAnArgument() = node.asExpr() and
138+
annotation.getTarget() = ma.getMethod().getParameter(node.asExpr().getIndex())
138139
)
139140
or
140141
// MyBatis default parameter sql injection vulnerabilities.the default parameter form of the method is arg[0...n] or param[1...n].

0 commit comments

Comments
 (0)