@@ -4,16 +4,29 @@ import java
44private import semmle.code.java.dataflow.DataFlow
55private import semmle.code.java.dataflow.ExternalFlow
66private import semmle.code.java.dataflow.FlowSources
7- private import semmle.code.java.frameworks.Servlets
87
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 }
1118}
1219
20+ /**
21+ * A sink for data that crosses a trust boundary.
22+ */
1323class TrustBoundaryViolationSink extends DataFlow:: Node {
1424 TrustBoundaryViolationSink ( ) { sinkNode ( this , "trust-boundary" ) }
1525}
1626
27+ /**
28+ * Taint tracking for data that crosses a trust boundary.
29+ */
1730module TrustBoundaryConfig implements DataFlow:: ConfigSig {
1831 predicate isSource ( DataFlow:: Node source ) { source instanceof TrustBoundaryViolationSource }
1932
@@ -24,4 +37,7 @@ module TrustBoundaryConfig implements DataFlow::ConfigSig {
2437 predicate isSink ( DataFlow:: Node sink ) { sink instanceof TrustBoundaryViolationSink }
2538}
2639
40+ /**
41+ * Taint-tracking flow for values which cross a trust boundary.
42+ */
2743module TrustBoundaryFlow = TaintTracking:: Global< TrustBoundaryConfig > ;
0 commit comments