@@ -615,6 +615,12 @@ private module WithParam<ParamSig P> {
615615 signature predicate guardChecksSig ( GuardNode g , ControlFlowNode node , boolean branch , P param ) ;
616616}
617617
618+ /**
619+ * Provides a set of barrier nodes for a guard that validates a node.
620+ *
621+ * This is expected to be used in `isBarrier`/`isSanitizer` definitions
622+ * in data flow and taint tracking.
623+ */
618624module ParameterizedBarrierGuard< ParamSig P, WithParam< P > :: guardChecksSig / 4 guardChecks> {
619625 /** Gets a node that is safely guarded by the given guard check with parameter `param`. */
620626 ExprNode getABarrierNode ( P param ) {
@@ -627,10 +633,16 @@ module ParameterizedBarrierGuard<ParamSig P, WithParam<P>::guardChecksSig/4 guar
627633 }
628634}
629635
636+ /**
637+ * Provides a set of barrier nodes for a guard that validates a node as described by an external predicate.
638+ *
639+ * This is expected to be used in `isBarrier`/`isSanitizer` definitions
640+ * in data flow and taint tracking.
641+ */
630642module ExternalBarrierGuard {
631643 private import semmle.python.ApiGraphs
632644
633- predicate guardCheck ( GuardNode g , ControlFlowNode node , boolean branch , string kind ) {
645+ private predicate guardCheck ( GuardNode g , ControlFlowNode node , boolean branch , string kind ) {
634646 exists ( API:: CallNode call , API:: Node parameter |
635647 parameter = call .getAParameter ( ) and
636648 parameter = ModelOutput:: getABarrierGuardNode ( kind , branch )
0 commit comments