@@ -69,8 +69,11 @@ class RhinoDefineClassMethod extends Method {
69
69
}
70
70
}
71
71
72
- /** Holds if `ma` is a method access of `ScriptEngineMethod`. */
73
- predicate scriptEngine ( MethodAccess ma , Expr sink ) {
72
+ /**
73
+ * Holds if `ma` is a call to a `ScriptEngineMethod` and `sink` is an argument that
74
+ * will be executed.
75
+ */
76
+ predicate isScriptArgument ( MethodAccess ma , Expr sink ) {
74
77
exists ( ScriptEngineMethod m |
75
78
m = ma .getMethod ( ) and
76
79
if m .getDeclaringType ( ) .getASupertype * ( ) .hasQualifiedName ( "javax.script" , "ScriptEngineFactory" )
@@ -113,15 +116,15 @@ predicate defineClass(MethodAccess ma, Expr sink) {
113
116
/** A script injection sink. */
114
117
class ScriptInjectionSink extends DataFlow:: ExprNode {
115
118
ScriptInjectionSink ( ) {
116
- scriptEngine ( _, this .getExpr ( ) ) or
119
+ isScriptArgument ( _, this .getExpr ( ) ) or
117
120
evaluateRhinoExpression ( _, this .getExpr ( ) ) or
118
121
compileScript ( _, this .getExpr ( ) ) or
119
122
defineClass ( _, this .getExpr ( ) )
120
123
}
121
124
122
125
/** An access to the method associated with this sink. */
123
126
MethodAccess getMethodAccess ( ) {
124
- scriptEngine ( result , this .getExpr ( ) ) or
127
+ isScriptArgument ( result , this .getExpr ( ) ) or
125
128
evaluateRhinoExpression ( result , this .getExpr ( ) ) or
126
129
compileScript ( result , this .getExpr ( ) ) or
127
130
defineClass ( result , this .getExpr ( ) )
0 commit comments