@@ -4,16 +4,29 @@ import java
4
4
private import semmle.code.java.dataflow.DataFlow
5
5
private import semmle.code.java.dataflow.ExternalFlow
6
6
private import semmle.code.java.dataflow.FlowSources
7
- private import semmle.code.java.frameworks.Servlets
8
7
9
- class TrustBoundaryViolationSource extends DataFlow:: Node {
10
- TrustBoundaryViolationSource ( ) { this .asExpr ( ) .getType ( ) instanceof HttpServletRequest }
8
+ /**
9
+ * A source of data that crosses a trust boundary.
10
+ */
11
+ abstract class TrustBoundaryViolationSource extends DataFlow:: Node { }
12
+
13
+ /**
14
+ * A node representing a servlet request.
15
+ */
16
+ private class ServletRequestSource extends TrustBoundaryViolationSource {
17
+ ServletRequestSource ( ) { this .asExpr ( ) .getType ( ) instanceof HttpServletRequest }
11
18
}
12
19
20
+ /**
21
+ * A sink for data that crosses a trust boundary.
22
+ */
13
23
class TrustBoundaryViolationSink extends DataFlow:: Node {
14
24
TrustBoundaryViolationSink ( ) { sinkNode ( this , "trust-boundary" ) }
15
25
}
16
26
27
+ /**
28
+ * Taint tracking for data that crosses a trust boundary.
29
+ */
17
30
module TrustBoundaryConfig implements DataFlow:: ConfigSig {
18
31
predicate isSource ( DataFlow:: Node source ) { source instanceof TrustBoundaryViolationSource }
19
32
@@ -24,4 +37,7 @@ module TrustBoundaryConfig implements DataFlow::ConfigSig {
24
37
predicate isSink ( DataFlow:: Node sink ) { sink instanceof TrustBoundaryViolationSink }
25
38
}
26
39
40
+ /**
41
+ * Taint-tracking flow for values which cross a trust boundary.
42
+ */
27
43
module TrustBoundaryFlow = TaintTracking:: Global< TrustBoundaryConfig > ;
0 commit comments