Skip to content

Commit

Permalink
Comments and import fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
egregius313 committed Jun 15, 2023
1 parent 261e419 commit d63ba40
Showing 1 changed file with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,29 @@ import java
private import semmle.code.java.dataflow.DataFlow
private import semmle.code.java.dataflow.ExternalFlow
private import semmle.code.java.dataflow.FlowSources
private import semmle.code.java.frameworks.Servlets

class TrustBoundaryViolationSource extends DataFlow::Node {
TrustBoundaryViolationSource() { this.asExpr().getType() instanceof HttpServletRequest }
/**
* A source of data that crosses a trust boundary.
*/
abstract class TrustBoundaryViolationSource extends DataFlow::Node { }

/**
* A node representing a servlet request.
*/
private class ServletRequestSource extends TrustBoundaryViolationSource {
ServletRequestSource() { this.asExpr().getType() instanceof HttpServletRequest }
}

/**
* A sink for data that crosses a trust boundary.
*/
class TrustBoundaryViolationSink extends DataFlow::Node {
TrustBoundaryViolationSink() { sinkNode(this, "trust-boundary") }
}

/**
* Taint tracking for data that crosses a trust boundary.
*/
module TrustBoundaryConfig implements DataFlow::ConfigSig {
predicate isSource(DataFlow::Node source) { source instanceof TrustBoundaryViolationSource }

Expand All @@ -24,4 +37,7 @@ module TrustBoundaryConfig implements DataFlow::ConfigSig {
predicate isSink(DataFlow::Node sink) { sink instanceof TrustBoundaryViolationSink }
}

/**
* Taint-tracking flow for values which cross a trust boundary.
*/
module TrustBoundaryFlow = TaintTracking::Global<TrustBoundaryConfig>;

0 comments on commit d63ba40

Please sign in to comment.