@@ -17,19 +17,17 @@ import java
17
17
import semmle.code.java.frameworks.android.Intent
18
18
import semmle.code.java.dataflow.FlowSources
19
19
import semmle.code.java.NumberFormatException
20
- import DataFlow :: PathGraph
20
+ import NfeLocalDoSFlow :: PathGraph
21
21
22
22
/**
23
23
* Taint configuration tracking flow from untrusted inputs to number conversion calls in exported Android compononents.
24
24
*/
25
- class NfeLocalDoSConfiguration extends TaintTracking:: Configuration {
26
- NfeLocalDoSConfiguration ( ) { this = "NFELocalDoSConfiguration" }
27
-
25
+ module NfeLocalDoSConfig implements DataFlow:: ConfigSig {
28
26
/** Holds if source is a remote flow source */
29
- override predicate isSource ( DataFlow:: Node source ) { source instanceof RemoteFlowSource }
27
+ predicate isSource ( DataFlow:: Node source ) { source instanceof RemoteFlowSource }
30
28
31
29
/** Holds if NFE is thrown but not caught */
32
- override predicate isSink ( DataFlow:: Node sink ) {
30
+ predicate isSink ( DataFlow:: Node sink ) {
33
31
exists ( Expr e |
34
32
e .getEnclosingCallable ( ) .getDeclaringType ( ) .( ExportableAndroidComponent ) .isExported ( ) and
35
33
throwsNfe ( e ) and
@@ -42,8 +40,10 @@ class NfeLocalDoSConfiguration extends TaintTracking::Configuration {
42
40
}
43
41
}
44
42
45
- from DataFlow:: PathNode source , DataFlow:: PathNode sink , NfeLocalDoSConfiguration conf
46
- where conf .hasFlowPath ( source , sink )
43
+ module NfeLocalDoSFlow = TaintTracking:: Global< NfeLocalDoSConfig > ;
44
+
45
+ from NfeLocalDoSFlow:: PathNode source , NfeLocalDoSFlow:: PathNode sink
46
+ where NfeLocalDoSFlow:: flowPath ( source , sink )
47
47
select sink .getNode ( ) , source , sink ,
48
48
"Uncaught NumberFormatException in an exported Android component due to $@." , source .getNode ( ) ,
49
49
"user-provided value"
0 commit comments