@@ -85,6 +85,12 @@ predicate isSinkImpl(DataFlow::Node sink, Expr command, string callChain) {
85
85
shellCommand ( command , callChain )
86
86
}
87
87
88
+ predicate isSanitizerImpl ( DataFlow:: Node node ) {
89
+ node .asExpr ( ) .getUnspecifiedType ( ) instanceof IntegralType
90
+ or
91
+ node .asExpr ( ) .getUnspecifiedType ( ) instanceof FloatingPointType
92
+ }
93
+
88
94
/**
89
95
* A `TaintTracking` configuration that's used to find the relevant `ExecState`s for a
90
96
* given sink. This avoids a cartesian product between all sinks and all `ExecState`s in
@@ -99,6 +105,8 @@ class ExecStateConfiguration extends TaintTracking2::Configuration {
99
105
100
106
override predicate isSink ( DataFlow:: Node sink ) { isSinkImpl ( sink , _, _) }
101
107
108
+ override predicate isSanitizer ( DataFlow:: Node node ) { isSanitizerImpl ( node ) }
109
+
102
110
override predicate isSanitizerOut ( DataFlow:: Node node ) {
103
111
isSink ( node , _) // Prevent duplicates along a call chain, since `shellCommand` will include wrappers
104
112
}
@@ -126,14 +134,7 @@ class ExecTaintConfiguration extends TaintTracking::Configuration {
126
134
state2 .( ExecState ) .getOutgoingNode ( ) = node2
127
135
}
128
136
129
- override predicate isSanitizer ( DataFlow:: Node node , DataFlow:: FlowState state ) {
130
- (
131
- node .asInstruction ( ) .getResultType ( ) instanceof IntegralType
132
- or
133
- node .asInstruction ( ) .getResultType ( ) instanceof FloatingPointType
134
- ) and
135
- state instanceof ConcatState
136
- }
137
+ override predicate isSanitizer ( DataFlow:: Node node ) { isSanitizerImpl ( node ) }
137
138
138
139
override predicate isSanitizerOut ( DataFlow:: Node node ) {
139
140
isSink ( node , _) // Prevent duplicates along a call chain, since `shellCommand` will include wrappers
0 commit comments