mirror of
https://github.com/github/codeql.git
synced 2026-03-05 15:16:47 +01:00
Convert trust boundary models to MaD
This commit is contained in:
@@ -7,11 +7,21 @@ private import semmle.code.java.dataflow.FlowSources
|
||||
private import semmle.code.java.frameworks.Servlets
|
||||
|
||||
class TrustBoundaryViolationSource extends DataFlow::Node {
|
||||
TrustBoundaryViolationSource() {
|
||||
this instanceof RemoteFlowSource and this.asExpr().getType() instanceof HttpServletRequest
|
||||
}
|
||||
TrustBoundaryViolationSource() { this.asExpr().getType() instanceof HttpServletRequest }
|
||||
}
|
||||
|
||||
class TrustBoundaryViolationSink extends DataFlow::Node {
|
||||
TrustBoundaryViolationSink() { sinkNode(this, "trust-boundary") }
|
||||
}
|
||||
|
||||
module TrustBoundaryConfig implements DataFlow::ConfigSig {
|
||||
predicate isSource(DataFlow::Node source) { source instanceof TrustBoundaryViolationSource }
|
||||
|
||||
predicate isAdditionalFlowStep(DataFlow::Node n1, DataFlow::Node n2) {
|
||||
n2.asExpr().(MethodAccess).getQualifier() = n1.asExpr()
|
||||
}
|
||||
|
||||
predicate isSink(DataFlow::Node sink) { sink instanceof TrustBoundaryViolationSink }
|
||||
}
|
||||
|
||||
module TrustBoundaryFlow = TaintTracking::Global<TrustBoundaryConfig>;
|
||||
|
||||
Reference in New Issue
Block a user