@@ -14,6 +14,8 @@ module XSS {
14
14
import semmle.code.csharp.security.dataflow.flowsinks.Html
15
15
import semmle.code.csharp.security.dataflow.flowsinks.Remote
16
16
import semmle.code.csharp.security.dataflow.flowsources.Remote
17
+ private import semmle.code.csharp.dataflow.DataFlow2
18
+ private import semmle.code.csharp.dataflow.TaintTracking2
17
19
18
20
/**
19
21
* Holds if there is tainted flow from `source` to `sink` that may lead to a
@@ -24,7 +26,7 @@ module XSS {
24
26
predicate xssFlow ( XssNode source , XssNode sink , string message ) {
25
27
// standard taint-tracking
26
28
exists (
27
- TaintTrackingConfiguration c , DataFlow :: PathNode sourceNode , DataFlow :: PathNode sinkNode
29
+ TaintTrackingConfiguration c , DataFlow2 :: PathNode sourceNode , DataFlow2 :: PathNode sinkNode
28
30
|
29
31
sourceNode = source .asDataFlowNode ( ) and
30
32
sinkNode = sink .asDataFlowNode ( ) and
@@ -46,7 +48,7 @@ module XSS {
46
48
47
49
module PathGraph {
48
50
query predicate edges ( XssNode pred , XssNode succ ) {
49
- exists ( DataFlow :: PathNode a , DataFlow :: PathNode b | DataFlow :: PathGraph:: edges ( a , b ) |
51
+ exists ( DataFlow2 :: PathNode a , DataFlow2 :: PathNode b | DataFlow2 :: PathGraph:: edges ( a , b ) |
50
52
pred .asDataFlowNode ( ) = a and
51
53
succ .asDataFlowNode ( ) = b
52
54
)
@@ -57,7 +59,7 @@ module XSS {
57
59
}
58
60
59
61
private newtype TXssNode =
60
- TXssDataFlowNode ( DataFlow :: PathNode node ) or
62
+ TXssDataFlowNode ( DataFlow2 :: PathNode node ) or
61
63
TXssAspNode ( AspInlineMember m )
62
64
63
65
/**
@@ -73,20 +75,20 @@ module XSS {
73
75
Location getLocation ( ) { none ( ) }
74
76
75
77
/** Gets the data flow node corresponding to this node, if any. */
76
- DataFlow :: PathNode asDataFlowNode ( ) { result = this .( XssDataFlowNode ) .getDataFlowNode ( ) }
78
+ DataFlow2 :: PathNode asDataFlowNode ( ) { result = this .( XssDataFlowNode ) .getDataFlowNode ( ) }
77
79
78
80
/** Gets the ASP inline code element corresponding to this node, if any. */
79
81
AspInlineMember asAspInlineMember ( ) { result = this .( XssAspNode ) .getAspInlineMember ( ) }
80
82
}
81
83
82
84
/** A data flow node, viewed as an XSS flow node. */
83
85
class XssDataFlowNode extends TXssDataFlowNode , XssNode {
84
- DataFlow :: PathNode node ;
86
+ DataFlow2 :: PathNode node ;
85
87
86
88
XssDataFlowNode ( ) { this = TXssDataFlowNode ( node ) }
87
89
88
90
/** Gets the data flow node corresponding to this node. */
89
- DataFlow :: PathNode getDataFlowNode ( ) { result = node }
91
+ DataFlow2 :: PathNode getDataFlowNode ( ) { result = node }
90
92
91
93
override string toString ( ) { result = node .toString ( ) }
92
94
@@ -130,7 +132,7 @@ module XSS {
130
132
/**
131
133
* A taint-tracking configuration for cross-site scripting (XSS) vulnerabilities.
132
134
*/
133
- class TaintTrackingConfiguration extends TaintTracking :: Configuration {
135
+ class TaintTrackingConfiguration extends TaintTracking2 :: Configuration {
134
136
TaintTrackingConfiguration ( ) { this = "XSSDataFlowConfiguration" }
135
137
136
138
override predicate isSource ( DataFlow:: Node source ) { source instanceof Source }
0 commit comments