9
9
import swift
10
10
import codeql.swift.dataflow.FlowSources
11
11
import codeql.swift.security.SensitiveExprs
12
- import codeql.swift.dataflow.DataFlow
13
- import codeql.swift.dataflow.TaintTracking
14
12
import codeql.swift.regex.Regex
15
13
16
- /**
17
- * A taint configuration for tainted data reaching any node.
18
- */
19
- module TaintReachConfig implements DataFlow:: ConfigSig {
20
- predicate isSource ( DataFlow:: Node node ) { node instanceof FlowSource }
21
-
22
- predicate isSink ( DataFlow:: Node node ) { any ( ) }
23
- }
24
-
25
- module TaintReachFlow = TaintTracking:: Global< TaintReachConfig > ;
26
-
27
- /**
28
- * Gets the total number of dataflow nodes that taint reaches (from any source).
29
- */
30
- int taintedNodesCount ( ) { result = count ( DataFlow:: Node n | TaintReachFlow:: flowTo ( n ) ) }
31
-
32
- /**
33
- * Gets the proportion of dataflow nodes that taint reaches (from any source),
34
- * expressed as a count per million nodes.
35
- */
36
- float taintReach ( ) { result = ( taintedNodesCount ( ) * 1000000.0 ) / count ( DataFlow:: Node n ) }
37
-
38
14
predicate statistic ( string what , string value ) {
39
15
what = "Files" and value = count ( File f ) .toString ( )
40
16
or
@@ -52,12 +28,6 @@ predicate statistic(string what, string value) {
52
28
or
53
29
what = "Sensitive expressions" and value = count ( SensitiveExpr e ) .toString ( )
54
30
or
55
- what = "Dataflow nodes (total)" and value = count ( DataFlow:: Node n ) .toString ( )
56
- or
57
- what = "Dataflow nodes (tainted)" and value = taintedNodesCount ( ) .toString ( )
58
- or
59
- what = "Taint reach (per million nodes)" and value = taintReach ( ) .toString ( )
60
- or
61
31
what = "Regular expression evals" and value = count ( RegexEval e ) .toString ( )
62
32
or
63
33
what = "Regular expression evals with associated regex" and
0 commit comments