@@ -83,7 +83,7 @@ private class DefaultJexlInjectionAdditionalTaintStep extends JexlInjectionAddit
83
83
*/
84
84
private predicate createJexlScriptStep ( DataFlow:: Node n1 , DataFlow:: Node n2 ) {
85
85
exists ( MethodAccess ma , Method m | m = ma .getMethod ( ) and n2 .asExpr ( ) = ma |
86
- isUnsafeEngine ( ma .getQualifier ( ) ) and
86
+ not isSafeEngine ( ma .getQualifier ( ) ) and
87
87
m instanceof CreateJexlScriptMethod and
88
88
n1 .asExpr ( ) = ma .getArgument ( 0 ) and
89
89
n1 .asExpr ( ) .getType ( ) instanceof TypeString
@@ -96,7 +96,7 @@ private predicate createJexlScriptStep(DataFlow::Node n1, DataFlow::Node n2) {
96
96
*/
97
97
private predicate createJexlExpressionStep ( DataFlow:: Node n1 , DataFlow:: Node n2 ) {
98
98
exists ( MethodAccess ma , Method m | m = ma .getMethod ( ) and n2 .asExpr ( ) = ma |
99
- isUnsafeEngine ( ma .getQualifier ( ) ) and
99
+ not isSafeEngine ( ma .getQualifier ( ) ) and
100
100
m instanceof CreateJexlExpressionMethod and
101
101
n1 .asExpr ( ) = ma .getAnArgument ( ) and
102
102
n1 .asExpr ( ) .getType ( ) instanceof TypeString
@@ -111,18 +111,18 @@ private predicate createJexlTemplateStep(DataFlow::Node n1, DataFlow::Node n2) {
111
111
exists ( MethodAccess ma , Method m , RefType taintType |
112
112
m = ma .getMethod ( ) and n2 .asExpr ( ) = ma and taintType = n1 .asExpr ( ) .getType ( )
113
113
|
114
- isUnsafeEngine ( ma .getQualifier ( ) ) and
114
+ not isSafeEngine ( ma .getQualifier ( ) ) and
115
115
m instanceof CreateJexlTemplateMethod and
116
116
n1 .asExpr ( ) = ma .getArgument ( [ 0 , 1 ] ) and
117
117
( taintType instanceof TypeString or taintType instanceof Reader )
118
118
)
119
119
}
120
120
121
121
/**
122
- * Holds if `expr` is a JEXL engine that is not configured with a sandbox.
122
+ * Holds if `expr` is a JEXL engine that is configured with a sandbox.
123
123
*/
124
- private predicate isUnsafeEngine ( Expr expr ) {
125
- not exists ( SandboxedJexlFlowConfig config | config .hasFlowTo ( DataFlow:: exprNode ( expr ) ) )
124
+ private predicate isSafeEngine ( Expr expr ) {
125
+ exists ( SandboxedJexlFlowConfig config | config .hasFlowTo ( DataFlow:: exprNode ( expr ) ) )
126
126
}
127
127
128
128
/**
0 commit comments