@@ -28,21 +28,21 @@ private class DefaultOgnlInjectionSinkModel extends SinkModelCsv {
28
28
override predicate row ( string row ) {
29
29
row =
30
30
[
31
- "org.apache.commons.ognl;Ognl;false;getValue;;;Argument[-1.. 0];ognl-injection" ,
32
- "org.apache.commons.ognl;Ognl;false;setValue;;;Argument[-1.. 0];ognl-injection" ,
33
- "org.apache.commons.ognl;Node;false ;getValue;;;Argument[-1..0 ];ognl-injection" ,
34
- "org.apache.commons.ognl;Node;false ;setValue;;;Argument[-1..0 ];ognl-injection" ,
31
+ "org.apache.commons.ognl;Ognl;false;getValue;;;Argument[0];ognl-injection" ,
32
+ "org.apache.commons.ognl;Ognl;false;setValue;;;Argument[0];ognl-injection" ,
33
+ "org.apache.commons.ognl;Node;true ;getValue;;;Argument[-1];ognl-injection" ,
34
+ "org.apache.commons.ognl;Node;true ;setValue;;;Argument[-1];ognl-injection" ,
35
35
"org.apache.commons.ognl.enhance;ExpressionAccessor;true;get;;;Argument[-1];ognl-injection" ,
36
36
"org.apache.commons.ognl.enhance;ExpressionAccessor;true;set;;;Argument[-1];ognl-injection" ,
37
- "ognl;Ognl;false;getValue;;;Argument[-1.. 0];ognl-injection" ,
38
- "ognl;Ognl;false;setValue;;;Argument[-1.. 0];ognl-injection" ,
39
- "ognl;Node;false;getValue;;;Argument[-1..0 ];ognl-injection" ,
40
- "ognl;Node;false;setValue;;;Argument[-1..0 ];ognl-injection" ,
37
+ "ognl;Ognl;false;getValue;;;Argument[0];ognl-injection" ,
38
+ "ognl;Ognl;false;setValue;;;Argument[0];ognl-injection" ,
39
+ "ognl;Node;false;getValue;;;Argument[-1];ognl-injection" ,
40
+ "ognl;Node;false;setValue;;;Argument[-1];ognl-injection" ,
41
41
"ognl.enhance;ExpressionAccessor;true;get;;;Argument[-1];ognl-injection" ,
42
42
"ognl.enhance;ExpressionAccessor;true;set;;;Argument[-1];ognl-injection" ,
43
- "com.opensymphony.xwork2.ognl;OgnlUtil;false;getValue;;;Argument[-1.. 0];ognl-injection" ,
44
- "com.opensymphony.xwork2.ognl;OgnlUtil;false;setValue;;;Argument[-1.. 0];ognl-injection" ,
45
- "com.opensymphony.xwork2.ognl;OgnlUtil;false;callMethod;;;Argument[-1.. 0];ognl-injection"
43
+ "com.opensymphony.xwork2.ognl;OgnlUtil;false;getValue;;;Argument[0];ognl-injection" ,
44
+ "com.opensymphony.xwork2.ognl;OgnlUtil;false;setValue;;;Argument[0];ognl-injection" ,
45
+ "com.opensymphony.xwork2.ognl;OgnlUtil;false;callMethod;;;Argument[0];ognl-injection"
46
46
]
47
47
}
48
48
}
@@ -91,12 +91,12 @@ private predicate parseCompileExpressionStep(DataFlow::Node n1, DataFlow::Node n
91
91
*/
92
92
private predicate getAccessorStep ( DataFlow:: Node n1 , DataFlow:: Node n2 ) {
93
93
exists ( MethodAccess ma , Method m |
94
- n1 .asExpr ( ) = ma .getQualifier ( ) and
95
- n2 .asExpr ( ) = ma and
96
94
ma .getMethod ( ) = m and
97
- m .getDeclaringType ( ) .getASupertype * ( ) instanceof TypeNode
98
- |
95
+ m .getDeclaringType ( ) .getASupertype * ( ) instanceof TypeNode and
99
96
m .hasName ( "getAccessor" )
97
+ |
98
+ n1 .asExpr ( ) = ma .getQualifier ( ) and
99
+ n2 .asExpr ( ) = ma
100
100
)
101
101
}
102
102
@@ -106,12 +106,12 @@ private predicate getAccessorStep(DataFlow::Node n1, DataFlow::Node n2) {
106
106
*/
107
107
private predicate setExpressionStep ( DataFlow:: Node n1 , DataFlow:: Node n2 ) {
108
108
exists ( MethodAccess ma , Method m |
109
- n1 .asExpr ( ) = ma .getArgument ( 0 ) and
110
- n2 .( PostUpdateNode ) .getPreUpdateNode ( ) .asExpr ( ) = ma .getQualifier ( ) and
111
109
ma .getMethod ( ) = m and
110
+ m .hasName ( "setExpression" ) and
112
111
m .getDeclaringType ( ) .getASupertype * ( ) instanceof TypeExpressionAccessor
113
112
|
114
- m .hasName ( "setExpression" )
113
+ n1 .asExpr ( ) = ma .getArgument ( 0 ) and
114
+ n2 .( DataFlow:: PostUpdateNode ) .getPreUpdateNode ( ) .asExpr ( ) = ma .getQualifier ( )
115
115
)
116
116
}
117
117
0 commit comments